Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

vtkStringStringMap Class Reference

#include <vtkStringStringMap.h>

Inheritance diagram for vtkStringStringMap:

Inheritance graph
[legend]
Collaboration diagram for vtkStringStringMap:

Collaboration graph
[legend]
List of all members.

Detailed Description

A character string hash table of paired integral values.

Note:
Strings are copied and stored UTF-16-encoded, but may be specified to the Insert, Erase, and Find methods as Latin-1-encoded C-strings (arrays of char), UTF-8-encoded strings (arrays of unsigned bytes), or UTF-16-encoded strings (arrays of 16-bit unsigned integers). Transcoding to UTF-16 is performed as necessary.
Author:
Sean McInerney
Version:
Revision
1.5
Date:
Date
2004/08/10 07:37:21

Definition at line 40 of file vtkStringStringMap.h.

Public Member Functions

 vtkTypeRevisionMacro (vtkStringStringMap, vtkExtensionsObject)
void PrintSelf (ostream &, vtkIndent)
vtkIdType GetSize (void) const
 Returns number of slots occupied, including those of removed items.

int IsEmpty (void) const
 Returns whether the map is empty or not.

void Clear (void)
 Erase all entries from the map.

vtkIdType GetCapacity (void) const
 Returns how many items the map can currently hold.

virtual void Swap (vtkStringStringMap *object)
 Swaps the elements of this object with those of specified object.

virtual const vtkUTF16ChTypeFindKey (const vtkUTF16ChType *other)
 Find the first key in the map associated with a second string.

const vtkUTF16ChTypeFindNextKey (void)
 Find the next key in the map associated with the value specified in a previous call to FindKey.

virtual int GetCheckUnique ()
 Toggle enforcement of uniqueness among string entries (default: true).

virtual void SetCheckUnique (int)
 Toggle enforcement of uniqueness among string entries (default: true).

virtual void CheckUniqueOn ()
 Toggle enforcement of uniqueness among string entries (default: true).

virtual void CheckUniqueOff ()
 Toggle enforcement of uniqueness among string entries (default: true).

virtual int GetCheckCase ()
 Toggle matching of upper/lower case characters in keys (default: true).

virtual void SetCheckCase (int)
 Toggle matching of upper/lower case characters in keys (default: true).

virtual void CheckCaseOn ()
 Toggle matching of upper/lower case characters in keys (default: true).

virtual void CheckCaseOff ()
 Toggle matching of upper/lower case characters in keys (default: true).

Methods for finding a table entry.
const vtkUTF16ChTypeFind (const vtkUTF16ChType *key) const
 Find the entry in the table with a given key string.

const vtkUTF16ChTypeFind (const vtkUTF8ChType *key) const
 Find the entry in the table with a given key string.

const vtkUTF16ChTypeFind (const char *key) const
 Find the entry in the table with a given key string.

Methods for adding a string-value pair table entry.
int Insert (const vtkUTF16ChType *key, const vtkUTF16ChType *value)
 Insert the specified string to the table paired with a second string.

int Insert (const vtkUTF8ChType *key, const vtkUTF8ChType *value)
 Insert the specified string to the table paired with a second string.

int Insert (const char *key, const char *value)
 Insert the specified string to the table paired with a second string.

Methods for removing a table entry.
int Erase (const vtkUTF16ChType *key)
 Erase the entry matching a given key string.

int Erase (const vtkUTF8ChType *key)
 Erase the entry matching a given key string.

int Erase (const char *key)
 Erase the entry matching a given key string.


Static Public Member Functions

vtkStringStringMapNew (void)

Protected Member Functions

 vtkStringStringMap (void)
 ~vtkStringStringMap ()


Constructor & Destructor Documentation

vtkStringStringMap::vtkStringStringMap void   )  [protected]
 

vtkStringStringMap::~vtkStringStringMap  )  [protected]
 


Member Function Documentation

virtual void vtkStringStringMap::CheckCaseOff  )  [virtual]
 

Toggle matching of upper/lower case characters in keys (default: true).

virtual void vtkStringStringMap::CheckCaseOn  )  [virtual]
 

Toggle matching of upper/lower case characters in keys (default: true).

virtual void vtkStringStringMap::CheckUniqueOff  )  [virtual]
 

Toggle enforcement of uniqueness among string entries (default: true).

virtual void vtkStringStringMap::CheckUniqueOn  )  [virtual]
 

Toggle enforcement of uniqueness among string entries (default: true).

void vtkStringStringMap::Clear void   ) 
 

Erase all entries from the map.

Exceptions:
bad_alloc Allocation of new string could throw.

int vtkStringStringMap::Erase const char *  key  )  [inline]
 

Erase the entry matching a given key string.

Parameters:
key A unique charactor string serving as the hash map key.
Exceptions:
bad_alloc If the specified key parameter must be transcoded to UTF-16, internal use of operator new may throw. If the key parameter is already a UTF-16 string, the Erase method is exception-safe.
Returns:
true for successful removal from the table or false when attempting to remove empty or non-existant strings.
Note:
The table is not changed if the specified key is empty or cannot be found.

Definition at line 382 of file vtkStringStringMap.h.

References Erase(), and LATIN1_TO_UTF16.

int vtkStringStringMap::Erase const vtkUTF8ChType key  )  [inline]
 

Erase the entry matching a given key string.

Parameters:
key A unique charactor string serving as the hash map key.
Exceptions:
bad_alloc If the specified key parameter must be transcoded to UTF-16, internal use of operator new may throw. If the key parameter is already a UTF-16 string, the Erase method is exception-safe.
Returns:
true for successful removal from the table or false when attempting to remove empty or non-existant strings.
Note:
The table is not changed if the specified key is empty or cannot be found.

Definition at line 375 of file vtkStringStringMap.h.

References Erase(), and UTF8_TO_UTF16.

int vtkStringStringMap::Erase const vtkUTF16ChType key  ) 
 

Erase the entry matching a given key string.

Parameters:
key A unique charactor string serving as the hash map key.
Exceptions:
bad_alloc If the specified key parameter must be transcoded to UTF-16, internal use of operator new may throw. If the key parameter is already a UTF-16 string, the Erase method is exception-safe.
Returns:
true for successful removal from the table or false when attempting to remove empty or non-existant strings.
Note:
The table is not changed if the specified key is empty or cannot be found.

Referenced by Erase().

const vtkUTF16ChType * vtkStringStringMap::Find const char *  key  )  const [inline]
 

Find the entry in the table with a given key string.

Parameters:
key A unique string serving as the hash map key.
Exceptions:
bad_alloc If the specified key parameter must be transcoded to UTF-16, internal use of operator new may throw. If the key parameter is already a UTF-16 string, the Find method is exception-safe.
Returns:
The UTF-16 string associated with the specified key if an entry matching the key is found within the table or null if the key is a removed, empty, or non-existant string.

Definition at line 350 of file vtkStringStringMap.h.

References Find(), and LATIN1_TO_UTF16.

const vtkUTF16ChType * vtkStringStringMap::Find const vtkUTF8ChType key  )  const [inline]
 

Find the entry in the table with a given key string.

Parameters:
key A unique string serving as the hash map key.
Exceptions:
bad_alloc If the specified key parameter must be transcoded to UTF-16, internal use of operator new may throw. If the key parameter is already a UTF-16 string, the Find method is exception-safe.
Returns:
The UTF-16 string associated with the specified key if an entry matching the key is found within the table or null if the key is a removed, empty, or non-existant string.

Definition at line 343 of file vtkStringStringMap.h.

References Find(), and UTF8_TO_UTF16.

const vtkUTF16ChType* vtkStringStringMap::Find const vtkUTF16ChType key  )  const
 

Find the entry in the table with a given key string.

Parameters:
key A unique string serving as the hash map key.
Exceptions:
bad_alloc If the specified key parameter must be transcoded to UTF-16, internal use of operator new may throw. If the key parameter is already a UTF-16 string, the Find method is exception-safe.
Returns:
The UTF-16 string associated with the specified key if an entry matching the key is found within the table or null if the key is a removed, empty, or non-existant string.

Referenced by Find().

virtual const vtkUTF16ChType* vtkStringStringMap::FindKey const vtkUTF16ChType other  )  [virtual]
 

Find the first key in the map associated with a second string.

Returns:
The key string on success, null otherwise.

const vtkUTF16ChType* vtkStringStringMap::FindNextKey void   ) 
 

Find the next key in the map associated with the value specified in a previous call to FindKey.

Returns:
The key string on success, null otherwise.

vtkIdType vtkStringStringMap::GetCapacity void   )  const
 

Returns how many items the map can currently hold.

Exceptions:
none. 

virtual int vtkStringStringMap::GetCheckCase  )  [virtual]
 

Toggle matching of upper/lower case characters in keys (default: true).

virtual int vtkStringStringMap::GetCheckUnique  )  [virtual]
 

Toggle enforcement of uniqueness among string entries (default: true).

vtkIdType vtkStringStringMap::GetSize void   )  const
 

Returns number of slots occupied, including those of removed items.

Exceptions:
none. 

int vtkStringStringMap::Insert const char *  key,
const char *  value
[inline]
 

Insert the specified string to the table paired with a second string.

Parameters:
key A unique charactor string serving as the hash map key.
value An integral value to be associated with the key.
Exceptions:
bad_alloc Internal use of operator new may throw.
overflow_error Thrown for requests to grow the table beyond its maximum capacity (~ 1<<31).
Returns:
true for successful additions to the table or false when attempting to insert empty or duplicate strings.

Definition at line 366 of file vtkStringStringMap.h.

References Insert(), and LATIN1_TO_UTF16.

int vtkStringStringMap::Insert const vtkUTF8ChType key,
const vtkUTF8ChType value
[inline]
 

Insert the specified string to the table paired with a second string.

Parameters:
key A unique charactor string serving as the hash map key.
value An integral value to be associated with the key.
Exceptions:
bad_alloc Internal use of operator new may throw.
overflow_error Thrown for requests to grow the table beyond its maximum capacity (~ 1<<31).
Returns:
true for successful additions to the table or false when attempting to insert empty or duplicate strings.

Definition at line 358 of file vtkStringStringMap.h.

References Insert(), and UTF8_TO_UTF16.

int vtkStringStringMap::Insert const vtkUTF16ChType key,
const vtkUTF16ChType value
 

Insert the specified string to the table paired with a second string.

Parameters:
key A unique charactor string serving as the hash map key.
value An integral value to be associated with the key.
Exceptions:
bad_alloc Internal use of operator new may throw.
overflow_error Thrown for requests to grow the table beyond its maximum capacity (~ 1<<31).
Returns:
true for successful additions to the table or false when attempting to insert empty or duplicate strings.

Referenced by Insert().

int vtkStringStringMap::IsEmpty void   )  const
 

Returns whether the map is empty or not.

Exceptions:
none. 

vtkStringStringMap* vtkStringStringMap::New void   )  [static]
 

Reimplemented from vtkExtensionsObject.

void vtkStringStringMap::PrintSelf ostream &  ,
vtkIndent 
[virtual]
 

Reimplemented from vtkExtensionsObject.

virtual void vtkStringStringMap::SetCheckCase int   )  [virtual]
 

Toggle matching of upper/lower case characters in keys (default: true).

virtual void vtkStringStringMap::SetCheckUnique int   )  [virtual]
 

Toggle enforcement of uniqueness among string entries (default: true).

virtual void vtkStringStringMap::Swap vtkStringStringMap object  )  [virtual]
 

Swaps the elements of this object with those of specified object.

vtkStringStringMap::vtkTypeRevisionMacro vtkStringStringMap  ,
vtkExtensionsObject 
 


The documentation for this class was generated from the following file:
Generated on Tue Aug 10 03:44:53 2004 for vtkExtensions by doxygen 1.3.7