diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/gamestringpool.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/gamestringpool.h')
| -rw-r--r-- | game/shared/gamestringpool.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/game/shared/gamestringpool.h b/game/shared/gamestringpool.h new file mode 100644 index 0000000..2dc941f --- /dev/null +++ b/game/shared/gamestringpool.h @@ -0,0 +1,35 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Pool of all per-level strings. Allocates memory for strings, +// consolodating duplicates. The memory is freed on behalf of clients +// at level transition. Strings are of type string_t. +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef GAMESTRINGPOOL_H +#define GAMESTRINGPOOL_H + +#if defined( _WIN32 ) +#pragma once +#endif + +//----------------------------------------------------------------------------- +// String allocation +//----------------------------------------------------------------------------- +string_t AllocPooledString( const char *pszValue ); +string_t AllocPooledString_StaticConstantStringPointer( const char *pszGlobalConstValue ); +string_t FindPooledString( const char *pszValue ); + +#define AssertIsValidString( s ) AssertMsg( s == NULL_STRING || s == FindPooledString( STRING(s) ), "Invalid string " #s ); + +#ifndef GC +//----------------------------------------------------------------------------- +// String system accessor +//----------------------------------------------------------------------------- +class IGameSystem; + +IGameSystem *GameStringSystem(); +#endif // #ifndef GC + +#endif // GAMESTRINGPOOL_H |