mirror of
https://github.com/edubart/otclient.git
synced 2025-12-21 07:57:12 +01:00
reorganize all constants and place them into namespaces
This commit is contained in:
@@ -77,14 +77,14 @@ OTMLNodePtr OTMLNode::at(const std::string& childTag)
|
||||
}
|
||||
}
|
||||
if(!res)
|
||||
throw OTMLException(shared_from_this(), fw::mkstr("child node with tag '", childTag, "' not found"));
|
||||
throw OTMLException(shared_from_this(), Fw::mkstr("child node with tag '", childTag, "' not found"));
|
||||
return res;
|
||||
}
|
||||
|
||||
OTMLNodePtr OTMLNode::atIndex(int childIndex)
|
||||
{
|
||||
if(childIndex >= size() || childIndex < 0)
|
||||
throw OTMLException(shared_from_this(), fw::mkstr("child node with index '", childIndex, "' not found"));
|
||||
throw OTMLException(shared_from_this(), Fw::mkstr("child node with index '", childIndex, "' not found"));
|
||||
return m_children[childIndex];
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class OTMLNode : public std::enable_shared_from_this<OTMLNode>
|
||||
public:
|
||||
virtual ~OTMLNode() { }
|
||||
|
||||
static OTMLNodePtr create(std::string tag = fw::empty_string, bool unique = false);
|
||||
static OTMLNodePtr create(std::string tag = Fw::empty_string, bool unique = false);
|
||||
static OTMLNodePtr create(std::string tag, std::string value);
|
||||
|
||||
std::string tag() const { return m_tag; }
|
||||
@@ -106,8 +106,8 @@ protected:
|
||||
template<typename T>
|
||||
T OTMLNode::value() {
|
||||
T ret;
|
||||
if(!fw::cast(m_value, ret))
|
||||
throw OTMLException(shared_from_this(), fw::mkstr("failed to cast node value to type '", fw::demangle_type<T>(), "'"));
|
||||
if(!Fw::cast(m_value, ret))
|
||||
throw OTMLException(shared_from_this(), Fw::mkstr("failed to cast node value to type '", Fw::demangleType<T>(), "'"));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ T OTMLNode::valueAtIndex(int childIndex, const T& def) {
|
||||
|
||||
template<typename T>
|
||||
void OTMLNode::write(const T& v) {
|
||||
m_value = fw::safe_cast<std::string>(v);
|
||||
m_value = Fw::safeCast<std::string>(v);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
||||
@@ -181,7 +181,7 @@ void OTMLParser::parseNode(const std::string& data)
|
||||
|
||||
node->setUnique(dotsPos != std::string::npos);
|
||||
node->setTag(tag);
|
||||
node->setSource(doc->source() + ":" + fw::unsafe_cast<std::string>(nodeLine));
|
||||
node->setSource(doc->source() + ":" + Fw::unsafeCast<std::string>(nodeLine));
|
||||
|
||||
// ~ is considered the null value
|
||||
if(value == "~")
|
||||
|
||||
Reference in New Issue
Block a user