mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 12:06:07 +08:00
Update IKeyValuesSystem & obsolete public/vstdlib
This commit is contained in:
@ -198,7 +198,7 @@ typedef void (*pfnDemoCustomDataCallback)( uint8 *pData, size_t iSize );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Just an interface version name for the random number interface
|
||||
// See vstdlib/random.h for the interface definition
|
||||
// See tier1/random.h for the interface definition
|
||||
// NOTE: If you change this, also change VENGINE_SERVER_RANDOM_INTERFACE_VERSION in eiface.h
|
||||
//-----------------------------------------------------------------------------
|
||||
#define VENGINE_CLIENT_RANDOM_INTERFACE_VERSION "VEngineRandom001"
|
||||
|
@ -483,7 +483,7 @@ public:
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Just an interface version name for the random number interface
|
||||
// See vstdlib/random.h for the interface definition
|
||||
// See tier1/random.h for the interface definition
|
||||
// NOTE: If you change this, also change VENGINE_CLIENT_RANDOM_INTERFACE_VERSION in cdll_int.h
|
||||
//-----------------------------------------------------------------------------
|
||||
#define VENGINE_SERVER_RANDOM_INTERFACE_VERSION "VEngineRandom001"
|
||||
|
@ -24,7 +24,7 @@ class IMatRenderContext;
|
||||
|
||||
#include "dmxloader/dmxelement.h"
|
||||
#include "tier1/utlintrusivelist.h"
|
||||
#include "vstdlib/random.h"
|
||||
#include "tier1/random.h"
|
||||
#include "tier1/utlobjectreference.h"
|
||||
#include "tier1/utlstringmap.h"
|
||||
#include "tier1/utlmap.h"
|
||||
|
@ -10,8 +10,11 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "vstdlib/vstdlib.h"
|
||||
#include "tier0/platform.h"
|
||||
|
||||
class CUtlCharConversion;
|
||||
class CUtlScratchMemoryPool;
|
||||
class CTemporaryKeyValues;
|
||||
class KeyValues;
|
||||
|
||||
class HKeySymbol
|
||||
@ -33,8 +36,10 @@ private:
|
||||
class IKeyValuesSystem
|
||||
{
|
||||
public:
|
||||
virtual ~IKeyValuesSystem() = 0;
|
||||
|
||||
// allocates/frees a KeyValues object from the shared mempool
|
||||
virtual void *AllocKeyValuesMemory() = 0;
|
||||
virtual KeyValues *AllocKeyValuesMemory() = 0;
|
||||
virtual void FreeKeyValuesMemory(KeyValues *pKV) = 0;
|
||||
|
||||
// symbol table access (used for key names)
|
||||
@ -45,6 +50,8 @@ public:
|
||||
virtual void AddKeyValuesToMemoryLeakList(void *pMem, HKeySymbol name) = 0;
|
||||
virtual void RemoveKeyValuesFromMemoryLeakList(void *pMem) = 0;
|
||||
|
||||
virtual void unk001() = 0;
|
||||
|
||||
// set/get a value for keyvalues resolution symbol
|
||||
// e.g.: SetKeyValuesExpressionSymbol( "LOWVIOLENCE", true ) - enables [$LOWVIOLENCE]
|
||||
virtual void SetKeyValuesExpressionSymbol( const char *name, bool bValue ) = 0;
|
||||
@ -58,10 +65,16 @@ public:
|
||||
virtual void ReleaseStringCopy( const char * ) = 0;
|
||||
virtual const wchar_t *CopyWString( const wchar_t * ) = 0;
|
||||
virtual void ReleaseWStringCopy( const wchar_t * ) = 0;
|
||||
|
||||
virtual CUtlCharConversion *GetCharacterConversion( bool is_cstring ) = 0;
|
||||
|
||||
virtual CTemporaryKeyValues *AllocateTemporaryKeyValues() = 0;
|
||||
virtual void ReleaseTemporaryKeyValues( CTemporaryKeyValues *temp_kv ) = 0;
|
||||
|
||||
// Returns previously used memory pool if any
|
||||
virtual CUtlScratchMemoryPool *SetNewScratchMemoryPool( CUtlScratchMemoryPool *pool ) = 0;
|
||||
};
|
||||
|
||||
VSTDLIB_INTERFACE IKeyValuesSystem *KeyValuesSystem();
|
||||
|
||||
// #define KEYVALUESSYSTEM_INTERFACE_VERSION "KeyValuesSystem002"
|
||||
PLATFORM_INTERFACE IKeyValuesSystem *KeyValuesSystem();
|
||||
|
||||
#endif // VSTDLIB_IKEYVALUESSYSTEM_H
|
@ -20,10 +20,11 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "platform.h"
|
||||
#include "utlvector.h"
|
||||
#include "Color.h"
|
||||
#include "exprevaluator.h"
|
||||
#include <vstdlib/IKeyValuesSystem.h>
|
||||
#include "IKeyValuesSystem.h"
|
||||
|
||||
class IFileSystem;
|
||||
class CUtlBuffer;
|
||||
@ -49,15 +50,15 @@ typedef void *FileHandle_t;
|
||||
|
||||
DECLARE_POINTER_HANDLE( HTemporaryKeyValueAllocationScope );
|
||||
|
||||
PLATFORM_INTERFACE KeyValues *KeyValuesFromJSON( CUtlBuffer *buf, bool allow_unterminated = false, bool *parsed_successfully = nullptr );
|
||||
PLATFORM_INTERFACE bool KeyValuesToJSON( KeyValues *kv, CUtlBuffer *buf );
|
||||
|
||||
class CTemporaryKeyValues
|
||||
{
|
||||
CTemporaryKeyValues() : m_pKeyValues(nullptr), m_hScope() {}
|
||||
CTemporaryKeyValues() : m_pKeyValues( nullptr ), m_hScope() {}
|
||||
~CTemporaryKeyValues()
|
||||
{
|
||||
// GAMMACASE: TODO: Complete with actual KeyValuesSystem call once it's reversed too.
|
||||
#if 0
|
||||
KeyValuesSystem()->ReleaseTemporaryAllocationScope( m_hScope );
|
||||
#endif
|
||||
KeyValuesSystem()->ReleaseTemporaryKeyValues( this );
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -1,4 +1,4 @@
|
||||
//========== Copyright <20> 2006, Valve Corporation, All rights reserved. ========
|
||||
//========== Copyright <20> 2006, Valve Corporation, All rights reserved. ========
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@ -9,7 +9,7 @@
|
||||
|
||||
#include "tier0/tslist.h"
|
||||
#include "functors.h"
|
||||
#include "vstdlib/jobthread.h"
|
||||
#include "jobthread.h"
|
||||
|
||||
#if defined( _WIN32 )
|
||||
#pragma once
|
||||
|
@ -34,32 +34,29 @@ struct ExprNode
|
||||
typedef ExprNode *ExprTree;
|
||||
|
||||
// callback to evaluate a $<symbol> during evaluation, return true or false
|
||||
typedef bool (*GetSymbolProc_t)( const char *pKey, void *pUnknown );
|
||||
typedef void (*SyntaxErrorProc_t)( const char *pReason );
|
||||
typedef bool (*GetSymbolProc_t)( const char *pKey, void *pData );
|
||||
typedef void (*SyntaxErrorProc_t)( const char *pReason, void *pData );
|
||||
|
||||
class CExpressionEvaluator
|
||||
{
|
||||
public:
|
||||
CExpressionEvaluator();
|
||||
~CExpressionEvaluator();
|
||||
bool Evaluate( bool &result, const char *pInfixExpression, GetSymbolProc_t pGetSymbolProc = 0, SyntaxErrorProc_t pSyntaxErrorProc = 0 );
|
||||
DLL_CLASS_IMPORT CExpressionEvaluator();
|
||||
DLL_CLASS_IMPORT ~CExpressionEvaluator();
|
||||
|
||||
DLL_CLASS_IMPORT bool Evaluate(
|
||||
bool &result, const char *pInfixExpression,
|
||||
GetSymbolProc_t pGetSymbolProc = nullptr, SyntaxErrorProc_t pSyntaxErrorProc = nullptr,
|
||||
void *pSymbolProcAdditionalData = nullptr, void *pErrorProcAdditionalData = nullptr
|
||||
);
|
||||
|
||||
DLL_CLASS_IMPORT bool EvaluateAsUnmarkedSymbols(
|
||||
bool &result, const char *pInfixExpression,
|
||||
GetSymbolProc_t pGetSymbolProc = nullptr, SyntaxErrorProc_t pSyntaxErrorProc = nullptr,
|
||||
void *pSymbolProcAdditionalData = nullptr, void *pErrorProcAdditionalData = nullptr
|
||||
);
|
||||
|
||||
private:
|
||||
CExpressionEvaluator( CExpressionEvaluator& ); // prevent copy constructor being used
|
||||
|
||||
char GetNextToken( void );
|
||||
void FreeNode( ExprNode *pNode );
|
||||
ExprNode *AllocateNode( void );
|
||||
void FreeTree( ExprTree &node );
|
||||
bool IsConditional( bool &bCondition, const char token );
|
||||
bool IsNotOp( const char token );
|
||||
bool IsIdentifierOrConstant( const char token );
|
||||
bool MakeExprNode( ExprTree &tree, char token, Kind kind, ExprTree left, ExprTree right );
|
||||
bool MakeFactor( ExprTree &tree );
|
||||
bool MakeTerm( ExprTree &tree );
|
||||
bool MakeExpression( ExprTree &tree );
|
||||
bool BuildExpression( void );
|
||||
bool SimplifyNode( ExprTree &node );
|
||||
CExpressionEvaluator( CExpressionEvaluator & ) = delete;
|
||||
|
||||
ExprTree m_ExprTree; // Tree representation of the expression
|
||||
char m_CurToken; // Current token read from the input expression
|
||||
@ -68,6 +65,8 @@ private:
|
||||
char m_Identifier[MAX_IDENTIFIER_LEN]; // Stores the identifier string
|
||||
GetSymbolProc_t m_pGetSymbolProc;
|
||||
SyntaxErrorProc_t m_pSyntaxErrorProc;
|
||||
void *m_pSymbolProcData;
|
||||
void *m_pErrorProcData;
|
||||
bool m_bSetup;
|
||||
};
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "tier1/utlvector.h"
|
||||
#include "tier1/functors.h"
|
||||
|
||||
#include "vstdlib/vstdlib.h"
|
||||
#include "platform.h"
|
||||
|
||||
#ifndef JOBTHREAD_H
|
||||
#define JOBTHREAD_H
|
||||
@ -1251,7 +1251,7 @@ private:
|
||||
// Raw thread launching
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
inline unsigned FunctorExecuteThread( void *pParam )
|
||||
inline uintp FunctorExecuteThread( void *pParam )
|
||||
{
|
||||
CFunctor *pFunctor = (CFunctor *)pParam;
|
||||
(*pFunctor)();
|
@ -1,4 +1,4 @@
|
||||
//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
|
||||
//===== Copyright <EFBFBD> 1996-2005, Valve Corporation, All rights reserved. ======//
|
||||
//
|
||||
// Purpose: Random number generator
|
||||
//
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef VSTDLIB_RANDOM_H
|
||||
#define VSTDLIB_RANDOM_H
|
||||
|
||||
#include "vstdlib/vstdlib.h"
|
||||
#include "platform.h"
|
||||
#include "tier0/basetypes.h"
|
||||
#include "tier0/threadtools.h"
|
||||
|
||||
@ -39,7 +39,7 @@ public:
|
||||
//-----------------------------------------------------------------------------
|
||||
// The standard generator of uniformly distributed random numbers
|
||||
//-----------------------------------------------------------------------------
|
||||
class VSTDLIB_CLASS CUniformRandomStream : public IUniformRandomStream
|
||||
class DLL_CLASS_IMPORT CUniformRandomStream : public IUniformRandomStream
|
||||
{
|
||||
public:
|
||||
CUniformRandomStream();
|
||||
@ -66,7 +66,7 @@ private:
|
||||
//-----------------------------------------------------------------------------
|
||||
// A generator of gaussian distributed random numbers
|
||||
//-----------------------------------------------------------------------------
|
||||
class VSTDLIB_CLASS CGaussianRandomStream
|
||||
class DLL_CLASS_IMPORT CGaussianRandomStream
|
||||
{
|
||||
public:
|
||||
// Passing in NULL will cause the gaussian stream to use the
|
||||
@ -91,17 +91,17 @@ private:
|
||||
//-----------------------------------------------------------------------------
|
||||
// A couple of convenience functions to access the library's global uniform stream
|
||||
//-----------------------------------------------------------------------------
|
||||
VSTDLIB_INTERFACE void RandomSeed( int iSeed );
|
||||
VSTDLIB_INTERFACE float RandomFloat( float flMinVal = 0.0f, float flMaxVal = 1.0f );
|
||||
VSTDLIB_INTERFACE float RandomFloatExp( float flMinVal = 0.0f, float flMaxVal = 1.0f, float flExponent = 1.0f );
|
||||
VSTDLIB_INTERFACE int RandomInt( int iMinVal, int iMaxVal );
|
||||
VSTDLIB_INTERFACE float RandomGaussianFloat( float flMean = 0.0f, float flStdDev = 1.0f );
|
||||
DLL_IMPORT void RandomSeed( int iSeed );
|
||||
DLL_IMPORT float RandomFloat( float flMinVal = 0.0f, float flMaxVal = 1.0f );
|
||||
DLL_IMPORT float RandomFloatExp( float flMinVal = 0.0f, float flMaxVal = 1.0f, float flExponent = 1.0f );
|
||||
DLL_IMPORT int RandomInt( int iMinVal, int iMaxVal );
|
||||
DLL_IMPORT float RandomGaussianFloat( float flMean = 0.0f, float flStdDev = 1.0f );
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Installs a global random number generator, which will affect the Random functions above
|
||||
//-----------------------------------------------------------------------------
|
||||
VSTDLIB_INTERFACE void InstallUniformRandomStream( IUniformRandomStream *pStream );
|
||||
DLL_IMPORT void InstallUniformRandomStream( IUniformRandomStream *pStream );
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include "unitlib/unitlib.h" // just here for tests - remove before checking in!!!
|
||||
|
||||
#include "platform.h"
|
||||
#include "tier1/utlmemory.h"
|
||||
#include "tier1/cbyteswap.h"
|
||||
#include "tier1/bufferstring.h"
|
||||
@ -36,7 +37,7 @@ struct characterset_t;
|
||||
// { '\t', "t" }
|
||||
// END_CHAR_CONVERSION( CStringConversion, '\\' )
|
||||
//-----------------------------------------------------------------------------
|
||||
class CUtlCharConversion
|
||||
class DLL_CLASS_IMPORT CUtlCharConversion
|
||||
{
|
||||
public:
|
||||
struct ConversionArray_t
|
||||
@ -45,7 +46,14 @@ public:
|
||||
const char *m_pReplacementString;
|
||||
};
|
||||
|
||||
CUtlCharConversion( char nEscapeChar, const char *pDelimiter, int nCount, ConversionArray_t *pArray );
|
||||
CUtlCharConversion( char nEscapeChar, const char *pDelimiter, int nCount, const ConversionArray_t *pArray );
|
||||
|
||||
CUtlCharConversion( CUtlCharConversion &&rhs );
|
||||
CUtlCharConversion( const CUtlCharConversion &rhs );
|
||||
|
||||
CUtlCharConversion &operator=( CUtlCharConversion &&rhs );
|
||||
CUtlCharConversion &operator=( const CUtlCharConversion &rhs );
|
||||
|
||||
char GetEscapeChar() const;
|
||||
const char *GetDelimiter() const;
|
||||
int GetDelimiterLength() const;
|
||||
@ -90,12 +98,12 @@ protected:
|
||||
//-----------------------------------------------------------------------------
|
||||
// Character conversions for C strings
|
||||
//-----------------------------------------------------------------------------
|
||||
CUtlCharConversion *GetCStringCharConversion();
|
||||
PLATFORM_INTERFACE CUtlCharConversion *GetCStringCharConversion();
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Character conversions for quoted strings, with no escape sequences
|
||||
// Character conversions for JSON strings
|
||||
//-----------------------------------------------------------------------------
|
||||
CUtlCharConversion *GetNoEscCharConversion();
|
||||
PLATFORM_INTERFACE CUtlCharConversion *GetJSONCharConversion();
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -106,13 +114,11 @@ CUtlCharConversion *GetNoEscCharConversion();
|
||||
|
||||
|
||||
|
||||
typedef unsigned short ushort;
|
||||
|
||||
template < class A >
|
||||
static const char *GetFmtStr( int nRadix = 10, bool bPrint = true ) { Assert( 0 ); return ""; }
|
||||
|
||||
template <> inline const char *GetFmtStr< short > ( int nRadix, bool bPrint ) { Assert( nRadix == 10 ); return "%hd"; }
|
||||
template <> inline const char *GetFmtStr< ushort > ( int nRadix, bool bPrint ) { Assert( nRadix == 10 ); return "%hu"; }
|
||||
template <> inline const char *GetFmtStr< uint16 > ( int nRadix, bool bPrint ) { Assert( nRadix == 10 ); return "%hu"; }
|
||||
template <> inline const char *GetFmtStr< int > ( int nRadix, bool bPrint ) { Assert( nRadix == 10 ); return "%d"; }
|
||||
template <> inline const char *GetFmtStr< uint > ( int nRadix, bool bPrint ) { Assert( nRadix == 10 || nRadix == 16 ); return nRadix == 16 ? "%x" : "%u"; }
|
||||
template <> inline const char *GetFmtStr< int64 > ( int nRadix, bool bPrint ) { Assert( nRadix == 10 ); return "%lld"; }
|
||||
|
@ -1,25 +0,0 @@
|
||||
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#if !defined( CVAR_H )
|
||||
#define CVAR_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "vstdlib/vstdlib.h"
|
||||
#include "icvar.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Returns a CVar dictionary for tool usage
|
||||
//-----------------------------------------------------------------------------
|
||||
VSTDLIB_INTERFACE CreateInterfaceFn VStdLib_GetICVarFactory();
|
||||
|
||||
|
||||
#endif // CVAR_H
|
@ -1,16 +0,0 @@
|
||||
#include <appframework/IAppSystem.h>
|
||||
#include <tier1/functors.h>
|
||||
|
||||
class IEventQueue;
|
||||
|
||||
abstract_class IEventSystem : public IAppSystem
|
||||
{
|
||||
public:
|
||||
virtual IEventQueue *CreateEventQueue() = 0;
|
||||
virtual void DestroyEventQueue( IEventQueue *pQueue ) = 0;
|
||||
virtual void RunEvents( IEventQueue *pQueue ) = 0;
|
||||
virtual int RegisterEvent( const char *pszName ) = 0;
|
||||
virtual void FireEvent( int eventId, IEventQueue *pQueue, const void *pListener, CFunctorData *pData ) = 0;
|
||||
virtual void RegisterListener( int eventId, IEventQueue *pQueue, CFunctorCallback *pCallback ) = 0;
|
||||
virtual void UnregisterListener( int eventId, IEventQueue *pQueue, CFunctorCallback *pCallback ) = 0;
|
||||
};
|
@ -1,51 +0,0 @@
|
||||
//======== (C) Copyright 1999, 2000 Valve, L.L.C. All rights reserved. ========
|
||||
//
|
||||
// The copyright to the contents herein is the property of Valve, L.L.C.
|
||||
// The contents may be used and/or copied only with the written permission of
|
||||
// Valve, L.L.C., or in accordance with the terms and conditions stipulated in
|
||||
// the agreement/contract under which the contents have been supplied.
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $Workfile: $
|
||||
// $NoKeywords: $
|
||||
//=============================================================================
|
||||
|
||||
|
||||
#pragma warning(disable: 4514)
|
||||
|
||||
// First include standard libraries
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <malloc.h>
|
||||
#include <memory.h>
|
||||
#include <ctype.h>
|
||||
|
||||
// Next, include public
|
||||
#include "tier0/basetypes.h"
|
||||
#include "tier0/dbg.h"
|
||||
#include "tier0/valobject.h"
|
||||
|
||||
// Next, include vstdlib
|
||||
#include "vstdlib/vstdlib.h"
|
||||
#include "tier1/strtools.h"
|
||||
#include "vstdlib/random.h"
|
||||
#include "tier1/keyvalues.h"
|
||||
#include "tier1/utlmemory.h"
|
||||
#include "tier1/utlrbtree.h"
|
||||
#include "tier1/utlvector.h"
|
||||
#include "tier1/utllinkedlist.h"
|
||||
#include "tier1/utlmultilist.h"
|
||||
#include "tier1/utlsymbol.h"
|
||||
#include "tier0/icommandline.h"
|
||||
#include "tier1/netadr.h"
|
||||
#include "tier1/mempool.h"
|
||||
#include "tier1/utlbuffer.h"
|
||||
#include "tier1/utlstring.h"
|
||||
#include "tier1/utlmap.h"
|
||||
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
|
||||
|
@ -1,125 +0,0 @@
|
||||
//========== Copyright <20> 2005, Valve Corporation, All rights reserved. ========
|
||||
//
|
||||
// Purpose: A simple tool for coverage tests
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef VCOVER_H
|
||||
#define VCOVER_H
|
||||
|
||||
#include "tier1/utlrbtree.h"
|
||||
#include "vstdlib.h"
|
||||
|
||||
#if defined( _WIN32 )
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
class CVCoverage
|
||||
{
|
||||
public:
|
||||
CVCoverage() :
|
||||
m_bActive( false ),
|
||||
m_depth( 0 ),
|
||||
m_token( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
bool IsActive() const
|
||||
{
|
||||
return m_bActive;
|
||||
}
|
||||
|
||||
void SetActive( bool bActive )
|
||||
{
|
||||
Assert( bActive != m_bActive );
|
||||
m_bActive = bActive;
|
||||
if ( bActive )
|
||||
++m_token;
|
||||
}
|
||||
|
||||
void Begin()
|
||||
{
|
||||
++m_depth;
|
||||
}
|
||||
|
||||
void End()
|
||||
{
|
||||
--m_depth;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_locations.RemoveAll();
|
||||
}
|
||||
|
||||
bool ShouldCover( unsigned token ) const
|
||||
{
|
||||
return ( m_bActive && m_depth > 0 && token != m_token );
|
||||
}
|
||||
|
||||
unsigned Cover( const char *pszFile, int line )
|
||||
{
|
||||
Location_t location = { pszFile, line };
|
||||
|
||||
m_locations.Insert( location );
|
||||
|
||||
return m_token;
|
||||
}
|
||||
|
||||
void Report()
|
||||
{
|
||||
for ( int i = m_locations.FirstInorder(); i != m_locations.InvalidIndex(); i = m_locations.NextInorder( i ) )
|
||||
{
|
||||
Msg( "%s(%d) :\n", m_locations[i].pszFile, m_locations[i].line );
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
struct Location_t
|
||||
{
|
||||
const char *pszFile;
|
||||
int line;
|
||||
|
||||
};
|
||||
|
||||
class CLocationLess
|
||||
{
|
||||
public:
|
||||
CLocationLess( int ignored ) {}
|
||||
bool operator!() { return false; }
|
||||
|
||||
bool operator()( const Location_t &lhs, const Location_t &rhs ) const
|
||||
{
|
||||
if ( lhs.line < rhs.line )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return CaselessStringLessThan( lhs.pszFile, rhs.pszFile );
|
||||
}
|
||||
};
|
||||
|
||||
bool m_bActive;
|
||||
int m_depth;
|
||||
unsigned m_token;
|
||||
|
||||
CUtlRBTree< Location_t, unsigned short, CLocationLess > m_locations;
|
||||
};
|
||||
|
||||
VSTDLIB_INTERFACE CVCoverage g_VCoverage;
|
||||
|
||||
#ifdef VCOVER_ENABLED
|
||||
#define VCOVER() \
|
||||
do \
|
||||
{ \
|
||||
static token; \
|
||||
if ( g_VCoverage.ShouldCover( token ) ) \
|
||||
{ \
|
||||
token = g_VCoverage.Cover( __FILE__, __LINE__ ); \
|
||||
} \
|
||||
} while( 0 )
|
||||
#else
|
||||
#define VCOVER() ((void)0)
|
||||
#endif
|
||||
|
||||
#endif // VCOVER_H
|
@ -1,33 +0,0 @@
|
||||
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef VSTDLIB_H
|
||||
#define VSTDLIB_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "tier0/platform.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// dll export stuff
|
||||
//-----------------------------------------------------------------------------
|
||||
#ifdef VSTDLIB_DLL_EXPORT
|
||||
#define VSTDLIB_INTERFACE DLL_EXPORT
|
||||
#define VSTDLIB_OVERLOAD DLL_GLOBAL_EXPORT
|
||||
#define VSTDLIB_CLASS DLL_CLASS_EXPORT
|
||||
#define VSTDLIB_GLOBAL DLL_GLOBAL_EXPORT
|
||||
#else
|
||||
#define VSTDLIB_INTERFACE DLL_IMPORT
|
||||
#define VSTDLIB_OVERLOAD DLL_GLOBAL_IMPORT
|
||||
#define VSTDLIB_CLASS DLL_CLASS_IMPORT
|
||||
#define VSTDLIB_GLOBAL DLL_GLOBAL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif // VSTDLIB_H
|
Reference in New Issue
Block a user