CmdLine.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. // Description : Implements the command line interface ICmdLine.
  9. #ifndef CRYINCLUDE_CRYSYSTEM_CMDLINE_H
  10. #define CRYINCLUDE_CRYSYSTEM_CMDLINE_H
  11. #pragma once
  12. #include <ICmdLine.h>
  13. #include "CmdLineArg.h"
  14. class CCmdLine
  15. : public ICmdLine
  16. {
  17. public:
  18. CCmdLine(const char* commandLine);
  19. virtual ~CCmdLine();
  20. virtual const ICmdLineArg* GetArg(int n) const;
  21. virtual int GetArgCount() const;
  22. virtual const ICmdLineArg* FindArg(const ECmdLineArgType ArgType, const char* name, bool caseSensitive = false) const;
  23. virtual const char* GetCommandLine() const { return m_sCmdLine.c_str(); };
  24. private:
  25. void PushCommand(const AZStd::string& sCommand, const AZStd::string& sParameter);
  26. AZStd::string Next(char*& str);
  27. AZStd::string m_sCmdLine;
  28. std::vector<CCmdLineArg> m_args;
  29. };
  30. #endif // CRYINCLUDE_CRYSYSTEM_CMDLINE_H