mirror of
https://github.com/edubart/otclient.git
synced 2026-01-11 08:31:29 +01:00
Rework stdext classes
Implement new classes: * stdext::any => ligher replacement for boost::any * stdext::packed_any => like any but optimized to use less memory * stdext::shared_object => ligher replacement for std::shared_ptr * stdext::shared_object_ptr => replacement for boost::intrusive_ptr * stdext::fast_storage => for storing dynamic data * stdext::packed_storage => same but with less memory * stdext::packed_vector => std::vector with less memory Compiling should be a little faster now because global boost including is not needed anymore
This commit is contained in:
@@ -89,7 +89,7 @@ public:
|
||||
|
||||
virtual std::string emit();
|
||||
|
||||
OTMLNodePtr asOTMLNode() { return self_cast<OTMLNode>(); }
|
||||
OTMLNodePtr asOTMLNode() { return static_self_cast<OTMLNode>(); }
|
||||
|
||||
protected:
|
||||
OTMLNode() : m_unique(false), m_null(false) { }
|
||||
@@ -107,13 +107,13 @@ protected:
|
||||
template<>
|
||||
inline std::string OTMLNode::value<std::string>() {
|
||||
std::string value = m_value;
|
||||
if(boost::starts_with(value, "\"") && boost::ends_with(value, "\"")) {
|
||||
if(stdext::starts_with(value, "\"") && stdext::ends_with(value, "\"")) {
|
||||
value = value.substr(1, value.length()-2);
|
||||
boost::replace_all(value, "\\\\", "\\");
|
||||
boost::replace_all(value, "\\\"", "\"");
|
||||
boost::replace_all(value, "\\t", "\t");
|
||||
boost::replace_all(value, "\\n", "\n");
|
||||
boost::replace_all(value, "\\'", "\'");
|
||||
stdext::replace_all(value, "\\\\", "\\");
|
||||
stdext::replace_all(value, "\\\"", "\"");
|
||||
stdext::replace_all(value, "\\t", "\t");
|
||||
stdext::replace_all(value, "\\n", "\n");
|
||||
stdext::replace_all(value, "\\'", "\'");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user