Verified Commit 7d9a82aa authored by Tobias WEBER's avatar Tobias WEBER
Browse files

cosmetic change

parent cbd40edc
......@@ -146,6 +146,7 @@ public:
return false;
}
bool Load(const t_ch* pcFile, PropType ty)
{
std::basic_ifstream<t_ch> ifstr(pcFile);
......@@ -165,6 +166,7 @@ public:
return Load(*pIfstr, ty);
}
bool Load(std::basic_istream<t_ch>& istr, PropType ty)
{
try
......@@ -217,6 +219,7 @@ public:
return false;
}
bool Save(const t_ch* pcFile, PropType ty, Compressor comp=Compressor::INVALID) const
{
std::basic_ofstream<t_ch> ofstr(pcFile);
......@@ -236,6 +239,7 @@ public:
return Save(*pOfstr, ty);
}
bool Save(std::basic_ostream<t_ch>& ofstr, PropType ty) const
{
#if BOOST_VERSION >= 105700
......@@ -306,12 +310,14 @@ public:
return tOut;
}
template<typename T>
T Query(const t_str& _strAddr, const T def, bool *pbOk=nullptr) const
{
return Query<T>(_strAddr, &def, pbOk);
}
template<typename T>
boost::optional<T> QueryOpt(const t_str& strAddr) const
{
......@@ -320,6 +326,7 @@ public:
return bOk ? boost::optional<T>(std::move(tVal)) : boost::optional<T>();
}
#if !defined NO_STR_PARSER
template<typename T>
T QueryAndParse(const t_str& _strAddr, const T* pDef=nullptr, bool *pbOk=nullptr) const
......@@ -346,7 +353,9 @@ public:
{
return QueryAndParse<T>(_strAddr, &def, pbOk);
}
#else // simply call normal query function
template<typename T>
T Query(const t_str& _strAddr, const T* pDef=nullptr, bool *pbOk=nullptr) const
{
......@@ -358,8 +367,10 @@ public:
{
return Query<T>(_strAddr, def, pbOk);
}
#endif
/**
* get children to a node
*/
......@@ -379,6 +390,7 @@ public:
return vecRet;
}
/**
* get a list of children to a node
*/
......@@ -398,6 +410,7 @@ public:
return vecRet;
}
/**
* get a list of child values to a node
*/
......@@ -418,6 +431,7 @@ public:
return vecRet;
}
bool Exists(const t_str& strAddr) const
{
bool bOk = 0;
......@@ -428,6 +442,7 @@ public:
return bOk;
}
bool PathExists(const t_str& strAddr) const
{
return GetChildNodes(strAddr).size() != 0;
......@@ -451,6 +466,7 @@ public:
}
}
template<class t_map = std::map<t_str, t_str>>
void Add(const t_map& map)
{
......@@ -467,6 +483,7 @@ public:
}
}
friend std::ostream& operator<<(std::ostream& ostr,
const Prop<_t_str, bCaseSensitive>& prop)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment