14#include "arcane/launcher/internal/ParamFile.h"
16#include "arcane/launcher/ArcaneLauncher.h"
18#include "arcane/utils/PlatformUtils.h"
19#include "arcane/utils/FatalErrorException.h"
20#include "arcane/utils/CommandLineArguments.h"
21#include "arcane/utils/JSONReader.h"
22#include "arccore/common/ArcaNetReader.h"
46 void readArcanePart(
JSONValue arcane_part);
47 String name()
const {
return m_name; }
58void ParamFile::ArgsFill::
72void ParamFile::ArgsFill::
73readArcanePart(
const JSONValue arcane_part)
75 const JSONValue dataset = arcane_part.
child(
"dataset");
76 if (!dataset.isNull()) {
77 m_args.addParameterLine(String::format(
"CaseDatasetFileName={0}", dataset.value()));
81 const JSONValue arcane_params = arcane_part.
child(
"options");
83 if (!arcane_params.isNull()) {
84 const JSONKeyValueList params = arcane_params.keyValueChildren();
86 for (
auto elem : params) {
87 m_args.addParameterLine(String::format(
"{0}={1}", elem.name(), elem.value().valueAsStringView()));
100editParams(
const String& param_file_name,
const String& variation)
104 JSONDocument json_doc;
106 UniqueArray<Byte> bytes;
115 ArcaNetReader reader(json_doc.root());
116 reader.init(variation,
"arcane");
121 ArrayView<JSONValue> json_values = reader.jsonValues();
122 for (JSONValue elem : json_values) {
123 args_fill.readFilePart(reader.extractFilePart(elem));
124 args_fill.readArcanePart(reader.extractProgPart(elem));
127 std::cout <<
"ArcaNet path: " << args_fill.name() << std::endl;
129 if (reader.computePath()) {
130 std::cout <<
"ArcaNet full path: " << reader.path() << std::endl;
131 std::cout <<
"ArcaNet config part readed: " << reader.configPartName() << std::endl;
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
void setCommandLineArguments(const CommandLineArguments &args)
Sets the command line arguments.
const CommandLineArguments & commandLineArguments() const
Command line arguments.
static ApplicationInfo & applicationInfo()
Application information.
@ ParseNumbersAsStringsFlag
Parse all numbers (ints/doubles) as strings.
@ ParseCommentsFlag
Allow one-line (//) and multi-line (/**/) comments.
StringView valueAsStringView() const
Value in StringView format. The string is empty if 'null()' is true.
bool isNull() const
True if the value is of 'null' type.
JSONValue child(StringView name) const
Child value with name name. Returns a null value if not found.
Unicode character string constructor.
Unicode character string.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --