reorganize all constants and place them into namespaces

This commit is contained in:
Eduardo Bart
2011-08-28 13:02:26 -03:00
parent dab483caab
commit e87297c1b5
62 changed files with 527 additions and 800 deletions

View File

@@ -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];
}

View File

@@ -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>

View File

@@ -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 == "~")