1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 20:16:10 +08:00
Files
hl2sdk/public/tier0/icommandline.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
2.4 KiB
C
Raw Normal View History

CS2 ConVar RE (#154) * progress report * clean up flags * progress report * remove some debug * Template the convar class * progress report * undo automatic symbol change * Get rid of ConCommandRefAbstract * remove debug * reorganise the headers, and add templated getter/setters * finish templating job * fix copyright symbol * dont break metamod compilation * template the entire ConVar class * template change callback * Use MAX_SPLITSCREEN_CLIENTS for IConVar definition * split convarhandle once more + template iconvar * Renaming IConVar and depollute ICVar * remove static_assert + IDA comments * renaming struct properties * undo icommandline change * make reglist simpler * Destroy ConCommandBase * move some functions to baseconvardata * put cvar values into its own struct * revise struct * remove padding * add back unknown * finish templating * fix wrong ret value * review changes * small mistake * setup times changed * expose handle * add character_t include to icvar * Streamline build for others This commit will be reverted eventually * Update command completion cb signatures * Update ConVarValueInfo_t & CConVarBaseData * Update CCommand * Update ICvar * Update ConCommand & cb structs * Fix few typos * Add ConVarRefAbstract & update ConVar api Also a lot of small code reshufflings/cleanup * Add CCvar * Cleanup CONVAR_WORK_FINISHED defines * Few small corrections * Remove ConCommandBase declaration * Add concommand/convar register callbacks --------- Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com> Co-authored-by: GAMMACASE <31375974+GAMMACASE@users.noreply.github.com>
2025-02-15 17:26:37 +01:00
//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
//
// Purpose:
//
//===========================================================================//
#ifndef TIER0_ICOMMANDLINE_H
#define TIER0_ICOMMANDLINE_H
#ifdef _WIN32
#pragma once
#endif
#include "tier0/platform.h"
#include "tier1/utlstringtoken.h"
class CBufferString;
//-----------------------------------------------------------------------------
// Purpose: Interface to engine command line
//-----------------------------------------------------------------------------
abstract_class ICommandLine
{
public:
virtual void CreateCmdLine( const char *commandline ) = 0;
virtual void CreateCmdLine( int argc, char **argv ) = 0;
virtual void CreateCmdLinePrependAppName( const char *commandline ) = 0;
// Check whether a particular parameter exists
virtual const char *CheckParm( CUtlStringToken param, const char **ppszValue = 0 ) const = 0;
virtual bool HasParm( CUtlStringToken param ) const = 0;
2013-03-21 21:13:05 -04:00
// Gets at particular parameters
virtual int ParmCount() const = 0;
virtual int FindParm( CUtlStringToken param ) const = 0; // Returns 0 if not found.
2013-03-21 21:13:05 -04:00
virtual const char* GetParm( int nIndex ) const = 0;
// Returns the argument after the one specified, or the default if not found
virtual const char *ParmValue( CUtlStringToken param, const char *pDefaultVal = 0 ) const = 0;
virtual int ParmValue( CUtlStringToken param, int nDefaultVal ) const = 0;
virtual float ParmValue( CUtlStringToken param, float flDefaultVal ) const = 0;
virtual bool ParmValue( CUtlStringToken param, const char *pDefaultVal, CBufferString *bufOut ) = 0;
2013-07-12 07:30:00 -05:00
virtual const char **GetParms() const = 0;
virtual const char *GetCmdLine( void ) const = 0;
virtual void AppendParm( CUtlStringToken param, const char *pszValues ) = 0;
// Returns true if there's atleast one parm available
virtual bool HasParms( void ) const = 0;
virtual const char *GetUnkString() = 0;
};
//-----------------------------------------------------------------------------
// Gets a singleton to the commandline interface
// NOTE: The #define trickery here is necessary for backwards compat:
// this interface used to lie in the vstdlib library.
//-----------------------------------------------------------------------------
PLATFORM_INTERFACE ICommandLine *CommandLine();
#endif // TIER0_ICOMMANDLINE_H