Main Page Modules Namespaces C++ Classes Compound List File List Index
TNL::StringTable Namespace Reference

TNL::StringTable Namespace Reference


Detailed Description

A global table for the hashing and tracking of network strings.


Functions

StringTableEntryId insert (const char *string, bool caseSens=true)
 Adds a string to the string table, and returns the id of the string.

StringTableEntryId insertn (const char *string, S32 len, bool caseSens=true)
 Adds a string to the string table, and returns the id of the string.

StringTableEntryId lookup (const char *string, bool caseSens=true)
 Determines if a string is in the string table, and returns the id of the string, or 0 if the string is not in the table.

StringTableEntryId lookupn (const char *string, S32 len, bool caseSens=true)
 Determines if a string is in the string table, and returns the id of the string, or 0 if the string is not in the table.

U32 hashString (const char *in_pString)
 Hash a string into a U32.

U32 hashStringn (const char *in_pString, S32 len)
 Hash a string of given length into a U32.

void incRef (StringTableEntryId index)
void decRef (StringTableEntryId index)
const char * getString (StringTableEntryId index)


Function Documentation

StringTableEntryId insert const char *  string,
bool  caseSens = true
 

Adds a string to the string table, and returns the id of the string.

Parameters:
string String to check in the table (and add).
caseSens Determines whether case matters.

StringTableEntryId insertn const char *  string,
S32  len,
bool  caseSens = true
 

Adds a string to the string table, and returns the id of the string.

Parameters:
string String to check in the table (and add).
len Length of the string in bytes.
caseSens Determines whether case matters.

StringTableEntryId lookup const char *  string,
bool  caseSens = true
 

Determines if a string is in the string table, and returns the id of the string, or 0 if the string is not in the table.

Parameters:
string String to check in the table (but not add).
caseSens Determines whether case matters.

StringTableEntryId lookupn const char *  string,
S32  len,
bool  caseSens = true
 

Determines if a string is in the string table, and returns the id of the string, or 0 if the string is not in the table.

Parameters:
string String to check in the table (but not add).
len Length of string in bytes.
caseSens Determines whether case matters.

U32 hashString const char *  in_pString  ) 
 

Hash a string into a U32.

U32 hashStringn const char *  in_pString,
S32  len
 

Hash a string of given length into a U32.

void incRef StringTableEntryId  index  ) 
 

void decRef StringTableEntryId  index  ) 
 

const char* getString StringTableEntryId  index  )