Team Fortress 2 Source Code as on 22/4/2020
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.

65 lines
2.4 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. virtual void RemoveParm( const char *parm ) = 0;
  24. virtual void AppendParm( const char *pszParm, const char *pszValues ) = 0;
  25. // Returns the argument after the one specified, or the default if not found
  26. virtual const char *ParmValue( const char *psz, const char *pDefaultVal = 0 ) const = 0;
  27. virtual int ParmValue( const char *psz, int nDefaultVal ) const = 0;
  28. virtual float ParmValue( const char *psz, float flDefaultVal ) const = 0;
  29. // Gets at particular parameters
  30. virtual int ParmCount() const = 0;
  31. virtual int FindParm( const char *psz ) const = 0; // Returns 0 if not found.
  32. virtual const char* GetParm( int nIndex ) const = 0;
  33. // copies the string passwed
  34. virtual void SetParm( int nIndex, char const *pNewParm ) =0;
  35. };
  36. //-----------------------------------------------------------------------------
  37. // Gets a singleton to the commandline interface
  38. // NOTE: The #define trickery here is necessary for backwards compat:
  39. // this interface used to lie in the vstdlib library.
  40. //-----------------------------------------------------------------------------
  41. PLATFORM_INTERFACE ICommandLine *CommandLine();
  42. //-----------------------------------------------------------------------------
  43. // Process related functions
  44. //-----------------------------------------------------------------------------
  45. PLATFORM_INTERFACE const tchar *Plat_GetCommandLine();
  46. #ifndef _WIN32
  47. // helper function for OS's that don't have a ::GetCommandLine() call
  48. PLATFORM_INTERFACE void Plat_SetCommandLine( const char *cmdLine );
  49. #endif
  50. PLATFORM_INTERFACE const char *Plat_GetCommandLineA();
  51. #endif // TIER0_ICOMMANDLINE_H