#include "CommandLineArgs.h"

CommandLineArgs::CommandLineArgs()
    : mArugments(),
      mLaunchPath()
{

}

std::unique_ptr<CommandLineArgs> CommandLineArgs::Create()
{
    return std::make_unique<CommandLineArgs>();
}

std::filesystem::path CommandLineArgs::getLaunchPath()
{
    return mLaunchPath;
}

void CommandLineArgs::recordLaunchPath()
{
    mLaunchPath = std::filesystem::current_path();
}

void CommandLineArgs::process(int argc, char *argv[])
{
    for(int idx=0; idx<argc; idx++)
    {
        mArugments.push_back(std::string(argv[idx]));
    }
}

void CommandLineArgs::process(const std::vector<std::string>& args)
{
    mArugments = args;
}

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 "";
}
