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

Parameter list. More...

#include <arccore/common/ParameterList.h>

Classes

class  Impl

Public Member Functions

 ParameterList ()
 Implementation.
 ParameterList (const ParameterList &rhs)
 Constructs a dictionary.
 ~ParameterList ()
 Frees resources.
String getParameterOrNull (const String &param_name) const
 Retrieves the parameter with name param_name.
bool addParameterLine (const String &line)
 Parses the line line.
void fillParameters (StringList &param_names, StringList &values) const
 Retrieves the list of parameters and their values.

Friends

class ParameterListWithCaseOption

Detailed Description

Parameter list.

A parameter list is similar to a set (key,value) but a key may potentially be present multiple times (a bit like the std::multi_map class).

Definition at line 36 of file arccore/src/common/arccore/common/ParameterList.h.

Constructor & Destructor Documentation

◆ ParameterList() [1/2]

Arcane::ParameterList::ParameterList ( )

Implementation.

Constructs a dictionary

Definition at line 134 of file ParameterList.cc.

Referenced by ParameterList().

◆ ParameterList() [2/2]

Arcane::ParameterList::ParameterList ( const ParameterList & rhs)

Constructs a dictionary.

Definition at line 143 of file ParameterList.cc.

References ParameterList().

◆ ~ParameterList()

Arcane::ParameterList::~ParameterList ( )

Frees resources.

Definition at line 152 of file ParameterList.cc.

Member Function Documentation

◆ addParameterLine()

bool Arcane::ParameterList::addParameterLine ( const String & line)

Parses the line line.

The line must have one of the following forms, with A the parameter and B the value:

  1. A=B,
  2. A:=B
  3. A+=B,
  4. A-=B

In case (1) or (3), the argument's value is added to the already present occurrences. In case (2), the argument's value replaces all already present occurrences. In case (4), the occurrence having the value B is deleted if it was present and nothing happens if it was absent.

Return values
falseif a parameter could be parsed
trueotherwise.

Definition at line 170 of file ParameterList.cc.

References Arcane::String::bytes(), Arcane::SpanImpl< T, SizeType, Extent >::length(), and Arcane::String::substring().

◆ fillParameters()

void Arcane::ParameterList::fillParameters ( StringList & param_names,
StringList & values ) const

Retrieves the list of parameters and their values.

Returns in param_names the list of parameter names and in values the associated value.

Definition at line 201 of file ParameterList.cc.

◆ getParameterOrNull()

String Arcane::ParameterList::getParameterOrNull ( const String & param_name) const

Retrieves the parameter with name param_name.

Returns a null string if there is no parameter with this name.

If the parameter is present multiple times, only the last value is returned.

Definition at line 161 of file ParameterList.cc.

◆ ParameterListWithCaseOption

friend class ParameterListWithCaseOption
friend

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