mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-03-22 09:44:19 -05:00
23 lines
450 B
C++
23 lines
450 B
C++
#include "cmdargs.hpp"
|
|
|
|
#include <vector>
|
|
|
|
namespace
|
|
{
|
|
/// @brief Stores pointers to the arguments passed to JKSV.
|
|
std::vector<const char *> s_args{};
|
|
}
|
|
|
|
void cmdargs::store(int argc, const char *argv[])
|
|
{
|
|
for (int i = 0; i < argc; i++) { s_args.push_back(argv[i]); }
|
|
}
|
|
|
|
const char *cmdargs::get(int index)
|
|
{
|
|
const int argCount = s_args.size();
|
|
if (index < 0 || index >= argCount) { return nullptr; }
|
|
|
|
return s_args[index];
|
|
}
|