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

36 lines
725 B
C
Raw Normal View History

2020-05-02 07:31:03 +00:00
#pragma once
#include <memory>
#include <vector>
#include <string>
2020-05-09 14:29:45 +00:00
#include <filesystem>
2020-05-02 07:31:03 +00:00
class CommandLineArgs
{
public:
2020-05-09 14:29:45 +00:00
CommandLineArgs();
2020-05-02 07:31:03 +00:00
2022-10-03 06:45:10 +00:00
static std::unique_ptr<CommandLineArgs> Create();
2020-05-02 07:31:03 +00:00
2022-10-03 06:45:10 +00:00
std::filesystem::path getLaunchPath();
2020-05-02 07:31:03 +00:00
2022-10-03 06:45:10 +00:00
std::size_t getNumberOfArgs() const;
2020-05-09 14:29:45 +00:00
2022-10-03 06:45:10 +00:00
std::string getArg(std::size_t index) const;
2020-05-09 14:29:45 +00:00
2022-10-03 06:45:10 +00:00
void process(int argc, char *argv[]);
2021-10-31 13:04:48 +00:00
2022-10-03 06:45:10 +00:00
void process(const std::vector<std::string>& args);
2020-05-09 14:29:45 +00:00
2022-10-03 06:45:10 +00:00
void recordLaunchPath();
2022-12-06 18:02:43 +00:00
std::vector<std::string> getUserArgs() const;
2023-01-05 13:16:52 +00:00
static void initialize(CommandLineArgs* args);
2022-10-03 06:45:10 +00:00
private:
std::vector<std::string> mArugments;
std::filesystem::path mLaunchPath;
2020-05-02 07:31:03 +00:00
};
2020-05-09 14:29:45 +00:00
using CommandLineArgsUPtr = std::unique_ptr<CommandLineArgs>;