home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar 2006 March
/
Gamestar_82_2006-03_dvd.iso
/
DVDStar
/
Editace
/
quake4_sdkv10.exe
/
source
/
idlib
/
LangDict.h
< prev
next >
Wrap
C/C++ Source or Header
|
2005-11-14
|
1KB
|
51 lines
#ifndef __LANGDICT_H__
#define __LANGDICT_H__
/*
===============================================================================
Simple dictionary specifically for the localized string tables.
===============================================================================
*/
class idLangKeyValue {
public:
idStr key;
idStr value;
};
class idLangDict {
public:
idLangDict( void );
~idLangDict( void );
void Clear( void );
bool Load( const char *fileName, bool clear = true );
void Save( const char *fileName );
const char * AddString( const char *str );
const char * GetString( const char *str ) const;
// adds the value and key as passed (doesn't generate a "#str_xxxxxx" key or ensure the key/value pair is unique)
void AddKeyVal( const char *key, const char *val );
int GetNumKeyVals( void ) const;
const idLangKeyValue * GetKeyVal( int i ) const;
void SetBaseID(int id) { baseID = id; };
private:
idList<idLangKeyValue> args;
idHashIndex hash;
bool ExcludeString( const char *str ) const;
int GetNextId( void ) const;
int GetHashKey( const char *str ) const;
int baseID;
};
#endif /* !__LANGDICT_H__ */