Flow123d
release_2.2.0-19-g1279b7e
|
Creates storage of IST defined in JSON or YAML file. More...
#include <reader_internal.hh>
Public Member Functions | |
ReaderInternal () | |
Constructor. More... | |
StorageBase * | read_storage (PathBase &p, const Type::TypeBase *type) |
Create storage of given type . More... | |
Public Member Functions inherited from Input::ReaderInternalBase | |
TYPEDEF_ERR_INFO (EI_InputType, string) | |
TYPEDEF_ERR_INFO (EI_File, const string) | |
TYPEDEF_ERR_INFO (EI_Specification, const string) | |
TYPEDEF_ERR_INFO (EI_Format, const string) | |
TYPEDEF_ERR_INFO (EI_JSON_Type, const string) | |
TYPEDEF_ERR_INFO (EI_ErrorAddress, string) | |
TYPEDEF_ERR_INFO (EI_TransposeIndex, unsigned int) | |
TYPEDEF_ERR_INFO (EI_TransposeAddress, string) | |
TYPEDEF_ERR_INFO (EI_JSONLine, unsigned int) | |
TYPEDEF_ERR_INFO (EI_JSONColumn, unsigned int) | |
TYPEDEF_ERR_INFO (EI_JSONReason, string) | |
TYPEDEF_ERR_INFO (EI_InputErrorMessage, const string) | |
TYPEDEF_ERR_INFO (EI_RecordName, const string) | |
TYPEDEF_ERR_INFO (EI_Tag, string) | |
TYPEDEF_ERR_INFO (EI_TokenizerMsg, std::string) | |
TYPEDEF_ERR_INFO (EI_ColumnIndex, unsigned int) | |
DECLARE_INPUT_EXCEPTION (ExcInputError,<< "Error in input file: "<< EI_File::qval<< " at address: "<< EI_ErrorAddress::qval<< "\n"<< EI_Specification::val<< "\n"<< EI_Format::val<< " type: "<< EI_JSON_Type::qval<< "\n"<< "Expected type:\n"<< EI_InputType::val) | |
General exception during conversion from JSON/YAML tree to storage. More... | |
DECLARE_INPUT_EXCEPTION (ExcNotJSONFormat,<< "Not valid JSON file "<< EI_File::qval<< ". Error at line "<< EI_JSONLine::val<< " : col "<< EI_JSONColumn::val<< " ; reason: "<< EI_JSONReason::val<< "\n") | |
DECLARE_INPUT_EXCEPTION (ExcAutomaticConversionError,<< "Error during automatic conversion of "<< EI_RecordName::val<< " record.\n "<< EI_InputErrorMessage::val<< "\n") | |
DECLARE_INPUT_EXCEPTION (ExcForbiddenTag,<< "Tag "<< EI_Tag::qval<< " "<< EI_Specification::val<< "\n") | |
DECLARE_INPUT_EXCEPTION (ExcWrongCsvFormat,<< EI_Specification::val<< ",\n"<< EI_TokenizerMsg::val<< "\n") | |
DECLARE_INPUT_EXCEPTION (ExcMultipleDefinitionCsvColumn,<< "Multiple definition of column with index "<< EI_ColumnIndex::qval<< " in included CSV file:\n"<< EI_File::val<< ",\n") | |
ReaderInternalBase () | |
Constructor. More... | |
Protected Member Functions | |
StorageBase * | make_sub_storage (PathBase &p, const Type::Array *array) override |
Create storage of Type::Array type. More... | |
StorageBase * | make_sub_storage (PathBase &p, const Type::Selection *selection) override |
Create storage of Type::Selection type. More... | |
StorageBase * | make_sub_storage (PathBase &p, const Type::Bool *bool_type) override |
Create storage of Type::Bool type. More... | |
StorageBase * | make_sub_storage (PathBase &p, const Type::Integer *int_type) override |
Create storage of Type::Integer type. More... | |
StorageBase * | make_sub_storage (PathBase &p, const Type::Double *double_type) override |
Create storage of Type::Double type. More... | |
StorageBase * | make_sub_storage (PathBase &p, const Type::String *string_type) override |
Create storage of Type::String type. More... | |
Protected Member Functions inherited from Input::ReaderInternalBase | |
StorageBase * | make_storage (PathBase &p, const Type::TypeBase *type) |
Create storage of given type . More... | |
StorageBase * | make_sub_storage (PathBase &p, const Type::Record *record) |
Create storage of Type::Record type. Common method of all descendants. More... | |
StorageBase * | make_sub_storage (PathBase &p, const Type::Tuple *tuple) |
Create storage of Type::Tuple type. Common method of all descendants. More... | |
StorageBase * | make_sub_storage (PathBase &p, const Type::Abstract *abstr_rec) |
Create storage of Type::Abstract type. Common method of all descendants. More... | |
StorageBase * | record_automatic_conversion (PathBase &p, const Type::Record *record) |
Apply automatic conversion of Type::Record type. More... | |
StorageBase * | abstract_automatic_conversion (PathBase &p, const Type::Abstract *abstr_rec) |
Apply automatic conversion of Type::Abstract type. More... | |
StorageBase * | make_array_storage (PathBase &p, const Type::Array *array, int arr_size) |
Create storage of Type::Array with given size. More... | |
StorageBase * | make_storage_from_default (const string &dflt_str, std::shared_ptr< Type::TypeBase > type) |
Dispatch according to type and create corresponding storage from the given string. More... | |
StorageBase * | make_include_storage (PathBase &p, const Type::TypeBase *type) |
Create storage of included YAML or JSON input file. More... | |
bool | read_bool_value (PathBase &p, const Type::TypeBase *type) |
Read boolean value from path. More... | |
std::int64_t | read_int_value (PathBase &p, const Type::TypeBase *type) |
Read integer value from path. More... | |
double | read_double_value (PathBase &p, const Type::TypeBase *type) |
Read double value from path. More... | |
std::string | read_string_value (PathBase &p, const Type::TypeBase *type) |
Read string value from path. More... | |
std::string | get_included_file (PathBase &p) |
Helper method. Get string value of included file or throw exception if reading failed. More... | |
void | generate_input_error (PathBase &p, const Type::TypeBase *type, std::string spec, bool add_type) |
Generate ExcInputError . More... | |
void | complete_input_error (ExcInputError &e, PathBase &p, ValueTypes value_type) |
Complete specification, error address and JSON type error tags to ExcInputError . More... | |
Creates storage of IST defined in JSON or YAML file.
This class works like start point of creating IST storage. Allows to use other descendants of ReaderInternalBase to construct storage of special parts of IST:
Definition at line 40 of file reader_internal.hh.
Input::ReaderInternal::ReaderInternal | ( | ) |
Constructor.
Definition at line 33 of file reader_internal.cc.
|
overrideprotectedvirtual |
Create storage of Type::Array type.
Implements Input::ReaderInternalBase.
Definition at line 41 of file reader_internal.cc.
|
overrideprotectedvirtual |
Create storage of Type::Selection type.
Implements Input::ReaderInternalBase.
Definition at line 57 of file reader_internal.cc.
|
overrideprotectedvirtual |
Create storage of Type::Bool type.
Implements Input::ReaderInternalBase.
Definition at line 70 of file reader_internal.cc.
|
overrideprotectedvirtual |
Create storage of Type::Integer type.
Implements Input::ReaderInternalBase.
Definition at line 75 of file reader_internal.cc.
|
overrideprotectedvirtual |
Create storage of Type::Double type.
Implements Input::ReaderInternalBase.
Definition at line 88 of file reader_internal.cc.
|
overrideprotectedvirtual |
Create storage of Type::String type.
Implements Input::ReaderInternalBase.
Definition at line 101 of file reader_internal.cc.
StorageBase * Input::ReaderInternal::read_storage | ( | PathBase & | p, |
const Type::TypeBase * | type | ||
) |
Create storage of given type
.
Definition at line 36 of file reader_internal.cc.