本文整理汇总了C++中AttributeMap::getBoolAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ AttributeMap::getBoolAttribute方法的具体用法?C++ AttributeMap::getBoolAttribute怎么用?C++ AttributeMap::getBoolAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AttributeMap
的用法示例。
在下文中一共展示了AttributeMap::getBoolAttribute方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleStartElement
void MAMFinParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) {
if (level_ == TopLevel) {
getPayloadInternal()->setComplete(attributes.getBoolAttribute("complete", false));
getPayloadInternal()->setStable(attributes.getBoolAttribute("stable", true));
boost::optional<std::string> attributeValue;
if ((attributeValue = attributes.getAttributeValue("queryid"))) {
getPayloadInternal()->setQueryID(*attributeValue);
}
}
else if (level_ == PayloadLevel) {
if (element == "set" && ns == "http://jabber.org/protocol/rsm") {
resultSetParser_ = boost::make_shared<ResultSetParser>();
}
}
if (resultSetParser_) { /* parsing a nested ResultSet */
resultSetParser_->handleStartElement(element, ns, attributes);
}
++level_;
}
示例2: handleStartElement
void StorageParser::handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes) {
if (level == BookmarkLevel) {
if (element == "conference") {
assert(!room);
room = Storage::Room();
room->autoJoin = attributes.getBoolAttribute("autojoin", false);
room->jid = JID(attributes.getAttribute("jid"));
room->name = attributes.getAttribute("name");
}
else if (element == "url") {
assert(!url);
url = Storage::URL();
url->name = attributes.getAttribute("name");
url->url = attributes.getAttribute("url");
}
}
else if (level == DetailLevel) {
currentText = "";
}
++level;
}
示例3: testGetBoolAttribute_UnknownWithDefaultFalse
void testGetBoolAttribute_UnknownWithDefaultFalse() {
AttributeMap testling;
CPPUNIT_ASSERT(!testling.getBoolAttribute("foo", false));
}
示例4: testGetBoolAttribute_UnknownWithDefaultTrue
void testGetBoolAttribute_UnknownWithDefaultTrue() {
AttributeMap testling;
CPPUNIT_ASSERT(testling.getBoolAttribute("foo", true));
}
示例5: testGetBoolAttribute_Invalid
void testGetBoolAttribute_Invalid() {
AttributeMap testling;
testling.addAttribute("foo", "", "bla");
CPPUNIT_ASSERT(!testling.getBoolAttribute("foo", true));
}
示例6: testGetBoolAttribute_False
void testGetBoolAttribute_False() {
AttributeMap testling;
testling.addAttribute("foo", "", "false");
CPPUNIT_ASSERT(!testling.getBoolAttribute("foo", true));
}
示例7:
void testGetBoolAttribute_1() {
AttributeMap testling;
testling.addAttribute("foo", "", "1");
CPPUNIT_ASSERT(testling.getBoolAttribute("foo"));
}
示例8:
void testGetBoolAttribute_0() {
AttributeMap testling;
testling["foo"] = "0";
CPPUNIT_ASSERT(!testling.getBoolAttribute("foo", true));
}