本文整理汇总了C++中DomString::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ DomString::empty方法的具体用法?C++ DomString::empty怎么用?C++ DomString::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DomString
的用法示例。
在下文中一共展示了DomString::empty方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: has_feature
bool DomImplementation::has_feature(
const DomString &feature,
const DomString &version)
{
if (StringHelp::compare(feature, "xml") == 0 && (version == "1.0" || version.empty()))
return true;
if (StringHelp::compare(feature, "xml") == 0 && (version == "2.0" || version.empty()))
return true;
return false;
}
示例2: get_attribute_float_ns
float DomElement::get_attribute_float_ns(const DomString &namespace_uri, const DomString &local_name, float default_value) const
{
DomString value = get_attribute_ns(namespace_uri, local_name);
if (!value.empty())
return StringHelp::text_to_float(value);
else
return default_value;
}
示例3: get_attribute_float
float DomElement::get_attribute_float(const DomString &name, float default_value) const
{
DomString value = get_attribute(name);
if (!value.empty())
return StringHelp::text_to_float(value);
else
return default_value;
}
示例4: get_attribute_bool_ns
bool DomElement::get_attribute_bool_ns(const DomString &namespace_uri, const DomString &local_name, bool default_value) const
{
DomString value = get_attribute_ns(namespace_uri, local_name);
if (!value.empty())
return value == "true";
else
return default_value;
}
示例5: get_attribute_bool
bool DomElement::get_attribute_bool(const DomString &name, bool default_value) const
{
DomString value = get_attribute(name);
if (!value.empty())
return value == "true";
else
return default_value;
}
示例6: get_child_int_ns
int DomElement::get_child_int_ns(const DomString &namespace_uri, const DomString &local_name, int default_value) const
{
DomString value = get_child_string_ns(namespace_uri, local_name);
if (!value.empty())
return StringHelp::text_to_int(value);
else
return default_value;
}
示例7: get_child_int
int DomElement::get_child_int(const DomString &name, int default_value) const
{
DomString value = get_child_string(name);
if (!value.empty())
return StringHelp::text_to_int(value);
else
return default_value;
}
示例8: is_supported
bool DomNode::is_supported(
const DomString &feature,
const DomString &version) const
{
if (StringHelp::compare(feature, "xml") == 0)
{
if (version.empty() || version == "1.0" || version == "2.0")
return true;
}
return false;
}
示例9: find_namespace_uri
DomString DomNode::find_namespace_uri(const DomString &qualified_name) const
{
static DomString xmlns_prefix("xmlns:");
static DomString xmlns_xml("xml");
static DomString xmlns_xml_uri("http://www.w3.org/XML/1998/namespace");
static DomString xmlns_xmlns("xmlns");
static DomString xmlns_xmlns_uri("http://www.w3.org/2000/xmlns/");
DomString prefix;
DomString::size_type pos = qualified_name.find(':');
if (pos != DomString::npos)
prefix = qualified_name.substr(0, pos);
if (prefix == xmlns_xml)
return xmlns_xml;
else if (prefix == xmlns_xmlns || qualified_name == xmlns_xmlns)
return xmlns_xmlns;
DomDocument_Impl *doc_impl = (DomDocument_Impl *)impl->owner_document.lock().get();
const DomTreeNode *cur = impl->get_tree_node();
while (cur)
{
const DomTreeNode *cur_attr = cur->get_first_attribute(doc_impl);
while (cur_attr)
{
std::string node_name = cur_attr->get_node_name();
if (prefix.empty())
{
if (node_name == xmlns_xmlns)
return cur_attr->get_node_value();
}
else
{
if (node_name.substr(0, 6) == xmlns_prefix && node_name.substr(6) == prefix)
return cur_attr->get_node_value();
}
cur_attr = cur_attr->get_next_sibling(doc_impl);
}
cur = cur->get_parent(doc_impl);
}
return DomString();
}