stuff-from-scratch/src/core/CommandLineArgs.cpp

30 lines
458 B
C++
Raw Normal View History

2020-05-02 07:31:03 +00:00
#include "CommandLineArgs.h"
CommandLineArgs::CommandLineArgs()
: mArugments()
{
}
void CommandLineArgs::Process(int argc, char *argv[])
{
for(int idx=0; idx<argc; idx++)
{
mArugments.push_back(std::string(argv[idx]));
}
}
std::size_t CommandLineArgs::GetNumberOfArgs() const
{
return mArugments.size();
}
std::string CommandLineArgs::GetArg(std::size_t index) const
{
if(index<mArugments.size())
{
return mArugments[index];
}
return "";
}