7#ifndef IFW_DIT_DID_HPP_
8#define IFW_DIT_DID_HPP_
71 void Load(
const std::string& did_filename,
const bool clear =
false);
83 const std::vector<ifw::core::dit::did::Header>&
GetHeaders()
const;
86 bool HasRecord(
const std::string& pattern,
const bool allow_idx_subst =
true)
const;
98 bool LookUp(
const std::string& pattern,
100 const bool allow_idx_subst =
true,
101 const bool exception =
true)
const;
114 std::vector<ifw::core::dit::did::Record>& records,
115 const bool allow_idx_subst =
true,
116 const bool exception =
false)
const;
119 void GetKeys(std::vector<std::string>& keys)
const;
128 const std::string& pattern =
"",
129 const bool compact =
false)
const;
135 std::unique_ptr<elt::configng::CiiConfigDocument> m_did_doc;
139 std::vector<std::string> m_dids_loaded;
140 std::vector<std::string> m_dids_loaded_complete_path;
143 std::vector<ifw::core::dit::did::Header> m_headers;
146 std::map<std::string, ifw::core::dit::did::Record> m_records;
149 std::map<std::string, ifw::core::dit::did::Record*> m_alt_records;
151 int16_t _LookUp(
const std::string& pattern,
152 std::vector<ifw::core::dit::did::Record> &records,
153 const bool allow_idx_subst,
154 const bool exception,
155 const int16_t max_records)
const;
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:69
void GetKeys(std::vector< std::string > &keys) const
Generate list of keys defined.
Definition did.cpp:393
void Load(const std::string &did_filename, const bool clear=false)
Load the referenced dictionary.
Definition did.cpp:85
void Clear()
Clear the object.
Definition did.cpp:77
const std::vector< std::string > & GetDidsLoaded() const
Get the filenames of the DIDs, currently loaded (el [0] = first DID loaded).
Definition did.cpp:200
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:215
~Did()
Definition did.cpp:73
static std::string SubstituteIndeces(const std::string &key)
Substitutes numeric indeces of keyword components to the generic representation.
Definition did.cpp:33
static std::string SubstituteIndex(const std::string &key)
Substitutes a numeric index of a keyword to obtain the generic representation.
Definition did.cpp:14
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:221
friend std::ostream & operator<<(std::ostream &os, const Did &did)
Dump the contents of the class on the output stream.
Definition did.cpp:387
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:306
const std::vector< std::string > & GetDidsLoadedCompletePath() const
Get the complete filenames of the DIDs, currently loaded (el [0] = first DID loaded).
Definition did.cpp:205
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:210
Data Interface Dictionary keyword record class.
Definition record.hpp:49
Definition defines.cpp:15
HdrSpec
Used to refer to which header(s) to address.
Definition did.hpp:20
@ ALL
Definition did.hpp:24
@ FIRST
Definition did.hpp:22
@ NONE
Definition did.hpp:21
@ LAST
Definition did.hpp:23