Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.6 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #ifndef TIER0_ICOMMANDLINE_H
  7. #define TIER0_ICOMMANDLINE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tier0/platform.h"
  12. //-----------------------------------------------------------------------------
  13. // Purpose: Interface to engine command line
  14. //-----------------------------------------------------------------------------
  15. abstract_class ICommandLine
  16. {
  17. public:
  18. virtual void CreateCmdLine( const char *commandline ) = 0;
  19. virtual void CreateCmdLine( int argc, char **argv ) = 0;
  20. virtual const char *GetCmdLine( void ) const = 0;
  21. // Check whether a particular parameter exists
  22. virtual const char *CheckParm( const char *psz, const char **ppszValue = 0 ) const = 0;
  23. // A bool return of whether param exists, useful for just checking if param that is just a flag is set
  24. virtual bool HasParm( const char *psz ) const = 0;
  25. virtual void RemoveParm( const char *parm ) = 0;
  26. virtual void AppendParm( const char *pszParm, const char *pszValues ) = 0;
  27. // Returns the argument after the one specified, or the default if not found
  28. virtual const char *ParmValue( const char *psz, const char *pDefaultVal = 0 ) const = 0;
  29. virtual int ParmValue( const char *psz, int nDefaultVal ) const = 0;
  30. virtual float ParmValue( const char *psz, float flDefaultVal ) const = 0;
  31. // Gets at particular parameters
  32. virtual int ParmCount() const = 0;
  33. virtual int FindParm( const char *psz ) const = 0; // Returns 0 if not found.
  34. virtual const char* GetParm( int nIndex ) const = 0;
  35. // copies the string passwed
  36. virtual void SetParm( int nIndex, char const *pNewParm ) =0;
  37. virtual const char **GetParms() const = 0;
  38. };
  39. //-----------------------------------------------------------------------------
  40. // Gets a singleton to the commandline interface
  41. // NOTE: The #define trickery here is necessary for backwards compat:
  42. // this interface used to lie in the vstdlib library.
  43. //-----------------------------------------------------------------------------
  44. PLATFORM_INTERFACE ICommandLine *CommandLine();
  45. //-----------------------------------------------------------------------------
  46. // Process related functions
  47. //-----------------------------------------------------------------------------
  48. PLATFORM_INTERFACE const tchar *Plat_GetCommandLine();
  49. #ifndef _WIN32
  50. // helper function for OS's that don't have a ::GetCommandLine() call
  51. PLATFORM_INTERFACE void Plat_SetCommandLine( const char *cmdLine );
  52. #endif
  53. PLATFORM_INTERFACE const char *Plat_GetCommandLineA();
  54. #endif // TIER0_ICOMMANDLINE_H