我是靠谱客的博主 诚心盼望,这篇文章主要介绍修改tinyxml让其支持解析特殊字符,现在分享给大家,希望可以做个参考。

修改tinyxmlparser.cpp文件中的部分代码如下:

TiXmlBase::Entity TiXmlBase::entity[ NUM_ENTITY ] = 
{
    { "&",  5, "&" },
    { "&lt;",   4, "<" },
    { "&gt;",   4, ">" },
    { "&quot;", 6, """ },
    { "&apos;", 6, "'" },
    { "&#955;", 6, "λ" },
    { "&#934;", 6, "Φ" },
    { "&#951;", 6, "η" }
};

const char* TiXmlBase::GetEntity( const char* p, char* value, int* length, TiXmlEncoding encoding )
{
	// Presume an entity, and pull it out.
    TIXML_STRING ent;
	int i;
	*length = 0;

    // Now try to match it.
	for( i=0; i<NUM_ENTITY; ++i )
	{
		if ( strncmp( entity[i].str, p, entity[i].strLength ) == 0 )
		{
			assert( strlen( entity[

最后

以上就是诚心盼望最近收集整理的关于修改tinyxml让其支持解析特殊字符的全部内容,更多相关修改tinyxml让其支持解析特殊字符内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(46)

评论列表共有 0 条评论

立即
投稿
返回
顶部