6 #ifndef IFW_DIT_DID_HPP_
7 #define IFW_DIT_DID_HPP_
73 void Load(
const std::string &did_filename,
const bool clear =
false);
85 const std::vector<dit::did::Header> &
GetHeaders()
const;
88 bool HasRecord(
const std::string &pattern,
const bool allow_idx_subst =
true)
const;
100 bool LookUp(
const std::string &pattern,
102 const bool allow_idx_subst =
true,
103 const bool exception =
true)
const;
116 std::vector<dit::did::Record> &records,
117 const bool allow_idx_subst =
true,
118 const bool exception =
false)
const;
121 void GetKeys(std::vector<std::string> &keys)
const;
130 const std::string &pattern =
"",
131 const bool compact =
false)
const;
134 friend std::ostream &
operator<<(std::ostream &os,
const Did &did);
137 std::unique_ptr<elt::configng::CiiConfigDocument> m_did_doc;
141 std::vector<std::string> m_dids_loaded;
142 std::vector<std::string> m_dids_loaded_complete_path;
145 std::vector<dit::did::Header> m_headers;
148 std::map<std::string, dit::did::Record> m_records;
151 std::map<std::string, dit::did::Record *> m_alt_records;
153 int16_t _LookUp(
const std::string &pattern,
154 std::vector<dit::did::Record> &records,
155 const bool allow_idx_subst,
156 const bool exception,
157 const int16_t max_records)
const;
Data Interface Dictionary class.
Definition: did.hpp:32
std::string ToString(HdrSpec header=HdrSpec::LAST, const std::string &pattern="", const bool compact=false) const
Create a DID from the content in the object in a string buffer.
Definition: did.cpp:302
bool LookUp(const std::string &pattern, dit::did::Record &record, const bool allow_idx_subst=true, const bool exception=true) const
Look up a key in the DIDs loaded. First occurrence taken.
Definition: did.cpp:218
~Did()
Definition: did.cpp:71
friend std::ostream & operator<<(std::ostream &os, const Did &did)
Dump the contents of the class on the output stream.
Definition: did.cpp:383
bool HasRecord(const std::string &pattern, const bool allow_idx_subst=true) const
Check if a record, is contained in the object.
Definition: did.cpp:212
static std::string SubstituteIndex(const std::string &key)
Substitutes a numeric index of a keyword to obtain the generic representation.
Definition: did.cpp:12
const std::vector< std::string > & GetDidsLoaded() const
Get the filenames of the DIDs, currently loaded (el [0] = first DID loaded).
Definition: did.cpp:197
void Clear()
Clear the object.
Definition: did.cpp:75
static std::string SubstituteIndeces(const std::string &key)
Substitutes numeric indeces of keyword components to the generic representation.
Definition: did.cpp:31
const std::vector< dit::did::Header > & GetHeaders() const
Get the header objects for the DIDs loaded (el [0] = first DID loaded).
Definition: did.cpp:207
const std::vector< std::string > & GetDidsLoadedCompletePath() const
Get the complete filenames of the DIDs, currently loaded (el [0] = first DID loaded).
Definition: did.cpp:202
void Load(const std::string &did_filename, const bool clear=false)
Load the referenced dictionary.
Definition: did.cpp:83
bool LookUp(const std::string &pattern, std::vector< dit::did::Record > &records, const bool allow_idx_subst=true, const bool exception=false) const
LookUp Scan the dictionary for keys with the given regular expression pattern.
void GetKeys(std::vector< std::string > &keys) const
Generate list of keys defined.
Definition: did.cpp:389
Did()
Definition: did.cpp:67
Data Interface Dictionary keyword record class.
Definition: record.hpp:46
Definition: defines.cpp:11
HdrSpec
Used to refer to which header(s) to address.
Definition: did.hpp:21
@ FIRST
Definition: did.hpp:23
@ NONE
Definition: did.hpp:22
@ LAST
Definition: did.hpp:24
@ ALL
Definition: did.hpp:25