9 #ifndef IFW_DIT_DID_HPP_
10 #define IFW_DIT_DID_HPP_
87 void Load(
const std::string& did_filename,
88 const bool merge =
false);
97 const std::vector<dit::did::Header>&
GetHeaders()
const;
100 bool HasRecord(
const std::string& pattern,
101 const bool allow_idx_subst =
true)
const;
113 bool LookUp(
const std::string& pattern,
115 const bool allow_idx_subst =
true,
116 const bool exception =
true)
const;
134 void Scan(
const std::string& pattern,
135 std::vector<dit::did::Record>& records,
136 const bool allow_idx_subst =
true,
137 const bool stop_first_match =
false,
138 const std::list<std::string>& classes = {
"*"},
140 const std::string& format_req_ex =
"*",
141 const std::string& default_value_reg_ex =
"*",
142 const std::string& unit_reg_ex =
"*",
143 const std::string& comment_req_ex =
"*",
144 const std::list<std::string>& tags_reg_ex = {
"*"},
145 const std::string& description_req_ex =
"*")
const;
157 bool LookUp(
const std::string& pattern,
158 std::vector<dit::did::Record>& records,
159 const bool allow_idx_subst =
true,
160 const bool exception =
false)
const;
166 void GetKeys(std::vector<std::string>& keys)
const;
175 const std::string& pattern =
"",
176 const bool compact =
false)
const;
179 friend std::ostream&
operator << (std::ostream& os,
184 std::map<std::string, dit::did::Record> m_records;
187 std::map<std::string, dit::did::Record*> m_alt_records;
191 std::vector<std::string> m_dids_loaded;
194 std::vector<dit::did::Header> m_headers;
197 void _Load(
const std::string& did_filename,
198 int8_t& recurse_level);
200 int16_t _LookUp(
const std::string& pattern,
201 std::vector<dit::did::Record>& records,
202 const bool allow_idx_subst,
203 const bool exception,
204 const int16_t max_records)
const;
211 #endif // !IFW_DIT_DID_HPP_
~Did()
Definition: Did.cpp:72
void Scan(const std::string &pattern, std::vector< dit::did::Record > &records, const bool allow_idx_subst=true, const bool stop_first_match=false, const std::list< std::string > &classes={"*"}, const ctd::defines::DataType data_types=ctd::defines::DATA_TYPE_ALL, const std::string &format_req_ex="*", const std::string &default_value_reg_ex="*", const std::string &unit_reg_ex="*", const std::string &comment_req_ex="*", const std::list< std::string > &tags_reg_ex={"*"}, const std::string &description_req_ex="*") const
Scan dictionary for key records with the given properties.
Definition: Did.cpp:370
const std::vector< std::string > & GetDidsLoaded() const
Get the filenames of the DIDs, currently loaded (el [0] = first DID loaded).
Definition: Did.cpp:165
Did()
Definition: Did.cpp:67
friend std::ostream & operator<<(std::ostream &os, const Did &did)
Dump the contents of the class on the output stream.
Definition: Did.cpp:361
void Clear()
Clear the object.
Definition: Did.cpp:77
void GetKeys(std::vector< std::string > &keys) const
Generate list of keys defined.
Definition: Did.cpp:389
DataType
Data types numeric representations.
Definition: types.hpp:34
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:188
Class to handle a DID Record.
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:179
void Add(dit::did::Record &record)
Add a keyword record in the dictionary object.
Definition: Did.cpp:279
static std::string SubstituteIndeces(const std::string &key)
Substitutes numeric indeces of keyword components to the generic representation.
Definition: Did.cpp:35
HeaderSpecifier
Used to refer to which header(s) to address.
Definition: Did.hpp:26
Data Interface Dictionary keyword record class.
Definition: Record.hpp:158
void Load(const std::string &did_filename, const bool merge=false)
Load the referenced dictionary.
Definition: Did.cpp:86
static std::string SubstituteIndex(const std::string &key)
Substitutes a numeric index of a keyword to obtain the generic representation.
Definition: Did.cpp:15
const std::vector< dit::did::Header > & GetHeaders() const
Get the header objects for the DIDs loaded (el [0] = first DID loaded).
Definition: Did.cpp:172
Data Interface Dictionary class.
Definition: Did.hpp:36
std::string ToString(const HeaderSpecifier header=DID_HDR_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:287