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

Classes

class  Impl

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.

Detailed Description

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.

Referenced by StringDictionary().

◆ StringDictionary() [2/3]

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

Constructs a dictionary.

Definition at line 72 of file StringDictionary.cc.

References StringDictionary().

◆ ~StringDictionary()

Arcane::StringDictionary::~StringDictionary ( )

Releases resources.

Definition at line 81 of file StringDictionary.cc.

◆ 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.

◆ 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().

◆ 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.

◆ 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.

◆ 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.

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