当前位置: 首页>>代码示例>>C++>>正文


C++ XMLString::compare方法代码示例

本文整理汇总了C++中XMLString::compare方法的典型用法代码示例。如果您正苦于以下问题:C++ XMLString::compare方法的具体用法?C++ XMLString::compare怎么用?C++ XMLString::compare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XMLString的用法示例。


在下文中一共展示了XMLString::compare方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: startElement

void currencyHandler::startElement(const XMLString& uri,
		const XMLString& localName, const XMLString& qname,
		const Attributes& attributes) {
	//		where("startElement");
	std::cout << "start element uri:       " << uri << std::endl
			<< "localName: " << localName << std::endl << "qname:     "
			<< qname << std::endl;

	if (localName.compare("resource") == 0) {
		std::cout << " Quote starting here.." << std::endl;

		inQuote = true;
	} else if (localName.compare("field") == 0) {
		std::cout << " field starting here.." << std::endl;
		//	std::cout<<" field value is "<<attributes.getValue(i)<<std::endl;
	}

	std::cout << "Attributes: " << std::endl;
	for (int i = 0; i < attributes.getLength(); ++i) {

		std::cout << " attributes.getValue(i) : " << attributes.getValue(i)
				<< std::endl;

		if (attributes.getValue(i).compare("symbol") == 0) {
			currentFieldReading = symbolType;

		} else if (attributes.getValue(i).compare("ts") == 0) {
			currentFieldReading = tsType;

		} else if (attributes.getValue(i).compare("utctime") == 0) {
			currentFieldReading = utctimelType;

		} else if (attributes.getValue(i).compare("volume") == 0) {
			currentFieldReading = volumeType;

		} else if (attributes.getValue(i).compare("price") == 0) {
			currentFieldReading = priceType;

		} else if (attributes.getValue(i).compare("name") == 0) {
			currentFieldReading = nameType;

		} else if (attributes.getValue(i).compare("type") == 0) {
			currentFieldReading = typeType;

		}

	}
}
开发者ID:taabodim,项目名称:QpidClient,代码行数:48,代码来源:currencyHandler.cpp

示例2: endElement

void currencyHandler::endElement(const XMLString& uri,
		const XMLString& localName, const XMLString& qname) {
	//where("endElement");
	//std::cout<<"localName is "<<localName<<"  allCurrencies size is "<<allCurrencies.size()<<std::endl;

	if (localName.compare("resource") == 0) {
		std::cout << " Quote ending  here.." << std::endl;
		inQuote = false;

		currency c = *currentReadingCurrency;
		allCurrencies.push_back(c);
		/*****************/
		//we can totally ignore comment these lines
		//	delete currentReadingCurrency;
		//		currentReadingCurrency = new currency();
		/***********************/
		std::cout << " currentReadingCurrency.toString() is "
				<< currentReadingCurrency->toString() << std::endl;
		std::cout << " c.toString() is " << c.toString() << std::endl;

	}

}
开发者ID:taabodim,项目名称:QpidClient,代码行数:23,代码来源:currencyHandler.cpp


注:本文中的XMLString::compare方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。