git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ticket 12. The if() construction for StopOnError parameter added in the
[stg.git]
/
stglibs
/
srvconf.lib
/
parsers
/
property.cpp
diff --git
a/stglibs/srvconf.lib/parsers/property.cpp
b/stglibs/srvconf.lib/parsers/property.cpp
index 8a78fe76593a2336178db51a58892588940b542c..eb9c2dfb66eb4d41d0df0e00a8db388da4d2c75b 100644
(file)
--- a/
stglibs/srvconf.lib/parsers/property.cpp
+++ b/
stglibs/srvconf.lib/parsers/property.cpp
@@
-22,22
+22,22
@@
#include <strings.h>
#include <strings.h>
-bool STG::CheckValue(const char ** attr)
+bool STG::CheckValue(const char ** attr
, const std::string & attrName
)
{
{
-return attr && attr[0] && attr[1] && strcasecmp(attr[0],
"value"
) == 0;
+return attr && attr[0] && attr[1] && strcasecmp(attr[0],
attrName.c_str()
) == 0;
}
}
-bool STG::GetEncodedValue(const char ** attr, std::string & value)
+bool STG::GetEncodedValue(const char ** attr, std::string & value
, const std::string & attrName
)
{
{
-if (!CheckValue(attr))
+if (!CheckValue(attr
, attrName
))
return false;
Decode21str(value, attr[1]);
return true;
}
return false;
Decode21str(value, attr[1]);
return true;
}
-bool STG::GetIPValue(const char ** attr, uint32_t & value)
+bool STG::GetIPValue(const char ** attr, uint32_t & value
, const std::string & attrName
)
{
{
-if (!CheckValue(attr))
+if (!CheckValue(attr
, attrName
))
return false;
std::string ip(attr[1]);
value = inet_strington(attr[1]);
return false;
std::string ip(attr[1]);
value = inet_strington(attr[1]);
@@
-46,10
+46,10
@@
if (value == 0 && ip != "0.0.0.0")
return true;
}
return true;
}
-bool STG::TryParse(PROPERTY_PARSERS & parsers, const std::string & name, const char ** attr)
+bool STG::TryParse(PROPERTY_PARSERS & parsers, const std::string & name, const char ** attr
, const std::string & toEncoding, const std::string & attrName
)
{
PROPERTY_PARSERS::iterator it(parsers.find(name));
if (it != parsers.end())
{
PROPERTY_PARSERS::iterator it(parsers.find(name));
if (it != parsers.end())
- return it->second->Parse(attr);
+ return it->second->Parse(attr
, attrName, toEncoding
);
return true; // Assume that non-existing params are ok.
}
return true; // Assume that non-existing params are ok.
}