Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
aiekick committed May 30, 2024
1 parent 4f0afd0 commit af9180f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/ctools/ConfigAbstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class CTOOLS_API ConfigAbstract {
virtual bool setFromXml(tinyxml2::XMLElement* vElem, tinyxml2::XMLElement* vParent, const std::string& vUserDatas) = 0;

public:
virtual ~ConfigAbstract() = default;

// replace patterns (who can break a xml code) by corresponding escaped pattern
std::string escapeXmlCode(std::string vDatas);

Expand Down
9 changes: 8 additions & 1 deletion src/cTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,14 @@ ::std::string ct::toLower(const std::string& vStr, const std::locale& vLocale) {
}

std::string ct::toHex(const std::string& vStr) {
CTOOL_DEBUG_BREAK;
if (!vStr.empty()) {
std::stringstream ss;
ss << std::setfill('0') << std::setw(2) << std::hex;
for (const auto& c : vStr) {
ss << (0xff & (unsigned int)c);
}
return ss.str();
}
return {};
}

Expand Down

0 comments on commit af9180f

Please sign in to comment.