本文整理汇总了C++中TextEncoding::characterMap方法的典型用法代码示例。如果您正苦于以下问题:C++ TextEncoding::characterMap方法的具体用法?C++ TextEncoding::characterMap怎么用?C++ TextEncoding::characterMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextEncoding
的用法示例。
在下文中一共展示了TextEncoding::characterMap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleUnknownEncoding
int ParserEngine::handleUnknownEncoding(void* encodingHandlerData, const XML_Char* name, XML_Encoding* info)
{
ParserEngine* pThis = reinterpret_cast<ParserEngine*>(encodingHandlerData);
XMLString encoding(name);
TextEncoding* knownEncoding = 0;
EncodingMap::const_iterator it = pThis->_encodings.find(encoding);
if (it != pThis->_encodings.end())
knownEncoding = it->second;
else
knownEncoding = Poco::TextEncoding::find(encoding);
if (knownEncoding)
{
const TextEncoding::CharacterMap& map = knownEncoding->characterMap();
for (int i = 0; i < 256; ++i)
info->map[i] = map[i];
info->data = knownEncoding;
info->convert = &ParserEngine::convert;
info->release = 0;
return XML_STATUS_OK;
}
else return XML_STATUS_ERROR;
}