14#include "arcane/impl/ConfigurationReader.h"
15#include "arcane/utils/JSONReader.h"
16#include "arcane/core/IConfiguration.h"
17#include "arcane/core/XmlNode.h"
18#include "arcane/core/XmlNodeList.h"
35 for (
Integer i = 0, n = sections.size(); i < n; ++i) {
41 if (sec_name.
null()) {
42 pwarning() <<
"Missing 'name' attribute in <section> in configuration file";
46 if (sec_value.
null()) {
47 pwarning() <<
"Missing 'value' attribute in <section> in configuration file";
53 sec_name.
split(all_names,
'.');
54 m_configuration->addValue(sec_name, sec_value, priority);
61void ConfigurationReader::
67 if (value.isObject()) {
68 _addValuesFromJSON(value, priority, base_name + name +
".");
70 else if (value.isArray()) {
75 String v_value = value.value();
77 m_configuration->addValue(base_name + name, v_value, priority);
88 _addValuesFromJSON(jv, priority,
String());
void clear()
Removes the elements from the array.
void addValuesFromXmlNode(const XmlNode &element, Integer priority)
Adds values to the configuration.
void addValuesFromJSON(const JSONValue &jv, Integer priority)
Adds values to the configuration.
Represents a (key,value) pair of JSON.
String value() const
Value in String format. The returned string is null if 'null()' is true.
Unicode character string.
bool null() const
Returns true if the string is null.
void split(StringContainer &str_array, char c) const
Splits the string based on the character c.
TraceMessage pwarning() const
1D data vector with value semantics (STL style).
List of nodes of a DOM tree.
String attrValue(const String &name, bool throw_exception=false) const
Value of attribute name.
XmlNodeList children(const String &name) const
Set of child nodes of this node having the name name.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.