6#ifndef IFW_DIT_DID_HPP_
7#define IFW_DIT_DID_HPP_
70 void Load(
const std::string& did_filename,
const bool clear =
false);
82 const std::vector<ifw::core::dit::did::Header>&
GetHeaders()
const;
85 bool HasRecord(
const std::string& pattern,
const bool allow_idx_subst =
true)
const;
97 bool LookUp(
const std::string& pattern,
99 const bool allow_idx_subst =
true,
100 const bool exception =
true)
const;
113 std::vector<ifw::core::dit::did::Record>& records,
114 const bool allow_idx_subst =
true,
115 const bool exception =
false)
const;
118 void GetKeys(std::vector<std::string>& keys)
const;
127 const std::string& pattern =
"",
128 const bool compact =
false)
const;
131 friend std::ostream &
operator<<(std::ostream& os,
const Did &did);
134 std::unique_ptr<elt::configng::CiiConfigDocument> m_did_doc;
138 std::vector<std::string> m_dids_loaded;
139 std::vector<std::string> m_dids_loaded_complete_path;
142 std::vector<ifw::core::dit::did::Header> m_headers;
145 std::map<std::string, ifw::core::dit::did::Record> m_records;
148 std::map<std::string, ifw::core::dit::did::Record*> m_alt_records;
150 int16_t _LookUp(
const std::string& pattern,
151 std::vector<ifw::core::dit::did::Record> &records,
152 const bool allow_idx_subst,
153 const bool exception,
154 const int16_t max_records)
const;
Data Interface Dictionary class.
Definition did.hpp:29
bool LookUp(const std::string &pattern, std::vector< ifw::core::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.
Did()
Definition did.cpp:67
void GetKeys(std::vector< std::string > &keys) const
Generate list of keys defined.
Definition did.cpp:391
void Load(const std::string &did_filename, const bool clear=false)
Load the referenced dictionary.
Definition did.cpp:83
void Clear()
Clear the object.
Definition did.cpp:75
const std::vector< std::string > & GetDidsLoaded() const
Get the filenames of the DIDs, currently loaded (el [0] = first DID loaded).
Definition did.cpp:198
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:213
~Did()
Definition did.cpp:71
static std::string SubstituteIndeces(const std::string &key)
Substitutes numeric indeces of keyword components to the generic representation.
Definition did.cpp:31
static std::string SubstituteIndex(const std::string &key)
Substitutes a numeric index of a keyword to obtain the generic representation.
Definition did.cpp:12
bool LookUp(const std::string &pattern, ifw::core::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:219
friend std::ostream & operator<<(std::ostream &os, const Did &did)
Dump the contents of the class on the output stream.
Definition did.cpp:385
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:304
const std::vector< std::string > & GetDidsLoadedCompletePath() const
Get the complete filenames of the DIDs, currently loaded (el [0] = first DID loaded).
Definition did.cpp:203
const std::vector< ifw::core::dit::did::Header > & GetHeaders() const
Get the header objects for the DIDs loaded (el [0] = first DID loaded).
Definition did.cpp:208
Data Interface Dictionary keyword record class.
Definition record.hpp:46
Definition defines.cpp:12
HdrSpec
Used to refer to which header(s) to address.
Definition did.hpp:19
@ ALL
Definition did.hpp:23
@ FIRST
Definition did.hpp:21
@ NONE
Definition did.hpp:20
@ LAST
Definition did.hpp:22