Changeset View
Changeset View
Standalone View
Standalone View
source/ps/GameSetup/CmdLineArgs.h
/* Copyright (C) 2022 Wildfire Games. | /* Copyright (C) 2023 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 10 Lines | |||||
#include "lib/os_path.h" | #include "lib/os_path.h" | ||||
#include "ps/containers/Span.h" | #include "ps/containers/Span.h" | ||||
#include "ps/CStr.h" | #include "ps/CStr.h" | ||||
#include <utility> | #include <utility> | ||||
#include <vector> | #include <vector> | ||||
class ScriptRequest; | |||||
namespace Script { | |||||
template<typename T> | |||||
void ToJSVal(const ScriptRequest& rq, JS::MutableHandleValue ret, const T& val); | |||||
} | |||||
vladislavbelov: Incorrect CC. | |||||
Done Inline ActionsNot entirely sure what you're referring to here, I think we don't indent root-level namespaces ? wraitii: Not entirely sure what you're referring to here, I think we don't indent root-level namespaces ? | |||||
class CmdLineArgs | class CmdLineArgs | ||||
{ | { | ||||
public: | public: | ||||
CmdLineArgs() {} | CmdLineArgs() {} | ||||
Done Inline ActionsShould be below public. vladislavbelov: Should be below `public`. | |||||
/** | /** | ||||
* Parse the command-line options, for future processing. | * Parse the command-line options, for future processing. | ||||
* All arguments are required to be of the form <tt>-name</tt> or | * All arguments are required to be of the form <tt>-name</tt> or | ||||
* <tt>-name=value</tt> - anything else is ignored. | * <tt>-name=value</tt> - anything else is ignored. | ||||
* | * | ||||
* @param argv span of arguments; argv[0] should be the program's name | * @param argv span of arguments; argv[0] should be the program's name | ||||
*/ | */ | ||||
Show All 25 Lines | public: | ||||
OsPath GetArg0() const; | OsPath GetArg0() const; | ||||
/** | /** | ||||
* Returns all arguments that don't have a name (string started with '-'). | * Returns all arguments that don't have a name (string started with '-'). | ||||
*/ | */ | ||||
std::vector<CStr> GetArgsWithoutName() const; | std::vector<CStr> GetArgsWithoutName() const; | ||||
private: | private: | ||||
template<typename T> | |||||
friend void Script::ToJSVal(const ScriptRequest& rq, JS::MutableHandleValue ret, const T& val); | |||||
typedef std::vector<std::pair<CStr, CStr> > ArgsT; | typedef std::vector<std::pair<CStr, CStr> > ArgsT; | ||||
ArgsT m_Args; | ArgsT m_Args; | ||||
OsPath m_Arg0; | OsPath m_Arg0; | ||||
std::vector<CStr> m_ArgsWithoutName; | std::vector<CStr> m_ArgsWithoutName; | ||||
}; | }; | ||||
extern CmdLineArgs g_CmdLineArgs; | extern CmdLineArgs g_CmdLineArgs; | ||||
#endif // INCLUDED_CMDLINEARGS | #endif // INCLUDED_CMDLINEARGS |
Wildfire Games · Phabricator
Incorrect CC.