Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::StringDictionary Class Reference

Unicode string dictionary. More...

#include <arcane/utils/StringDictionary.h>

Collaboration diagram for Arcane::StringDictionary:

Classes

class  Impl
 Implementation of the unicode string dictionary. More...

Public Member Functions

 StringDictionary ()
 Implementation.
 StringDictionary (const StringDictionary &rhs)
 Constructs a dictionary.
 ~StringDictionary ()
 Releases resources.
void add (const String &key, const String &value)
 Adds the (key, value) pair to the dictionary.
String remove (const String &key)
 Removes the value associated with key.
String find (const String &key, bool throw_exception=false) const
 Returns the value associated with key.
void fill (StringList &param_names, StringList &values) const
 Fills keys and values with the corresponding values from the dictionary.
 StringDictionary ()
 Implementation.
 StringDictionary (const StringDictionary &rhs)
 Constructs a dictionary.
 ~StringDictionary ()
 Releases resources.
void add (const String &key, const String &value)
 Adds the (key,value) pair to the dictionary.
String remove (const String &key)
 Removes the value associated with key.
String find (const String &key, bool throw_exception=false) const
 Returns the value associated with key.
void fill (StringList &param_names, StringList &values) const
 Fills keys and values with the corresponding values from the dictionary.

Private Attributes

Implm_p
 Implementation.

Detailed Description

Unicode string dictionary.

Maintains a list of (key, value) pairs allowing one string to be associated with another. This type of dictionary is used, for example, for translations, where the key is the language and the value is the corresponding translation.

Maintains a list of (key,value) pairs allowing one character string to another. This type of dictionary is used, for example, for translations, in which case the key is the language and the value is the corresponding translation.

Definition at line 35 of file arcane/src/arcane/utils/StringDictionary.h.

Constructor & Destructor Documentation

◆ StringDictionary() [1/3]

Arcane::StringDictionary::StringDictionary ( )

Implementation.

Constructs a dictionary

Definition at line 63 of file StringDictionary.cc.

References m_p.

Referenced by StringDictionary().

Here is the caller graph for this function:

◆ StringDictionary() [2/3]

Arcane::StringDictionary::StringDictionary ( const StringDictionary & rhs)

Constructs a dictionary.

Definition at line 72 of file StringDictionary.cc.

References m_p, and StringDictionary().

Here is the call graph for this function:

◆ ~StringDictionary()

Arcane::StringDictionary::~StringDictionary ( )

Releases resources.

Definition at line 81 of file StringDictionary.cc.

References m_p.

◆ StringDictionary() [3/3]

Arcane::StringDictionary::StringDictionary ( )

Implementation.

Constructs a dictionary

Member Function Documentation

◆ add() [1/2]

void Arcane::StringDictionary::add ( const String & key,
const String & value )

Adds the (key, value) pair to the dictionary.

If a value already exists for key, it is replaced by the new one.

Definition at line 90 of file StringDictionary.cc.

References m_p.

◆ add() [2/2]

void Arcane::StringDictionary::add ( const String & key,
const String & value )

Adds the (key,value) pair to the dictionary.

If a value already exists for key, it is replaced by the new one.

◆ fill()

void Arcane::StringDictionary::fill ( StringList & param_names,
StringList & values ) const

Fills keys and values with the corresponding values from the dictionary.

Definition at line 129 of file StringDictionary.cc.

References Arcane::CollectionBase::clear(), and m_p.

Here is the call graph for this function:

◆ find() [1/2]

String Arcane::StringDictionary::find ( const String & key,
bool throw_exception = false ) const

Returns the value associated with key.

If no value is associated with key, the null string is returned. It is not possible to distinguish between a value corresponding to the null string and an unfound value unless throw_exception is true, in which case an exception is thrown if no value corresponding to key exists.

Definition at line 114 of file StringDictionary.cc.

References m_p.

◆ find() [2/2]

String Arcane::StringDictionary::find ( const String & key,
bool throw_exception = false ) const

Returns the value associated with key.

If no value is associated with key, the null string is returned. It is not possible to distinguish between a value corresponding to the null string and a not found value unless throw_exception is true, in which case an exception is thrown if there is no value corresponding to key.

◆ remove() [1/2]

String Arcane::StringDictionary::remove ( const String & key)

Removes the value associated with key.

If no value was associated with key, nothing happens.

Returns
the removed value if one exists.

Definition at line 99 of file StringDictionary.cc.

References m_p.

◆ remove() [2/2]

String Arcane::StringDictionary::remove ( const String & key)

Removes the value associated with key.

If no value was associated with key, nothing happens.

Returns
the removed value if there is one.

Member Data Documentation

◆ m_p

Impl * Arcane::StringDictionary::m_p
private

The documentation for this class was generated from the following files: