本文整理汇总了C++中ParseElementChildren函数的典型用法代码示例。如果您正苦于以下问题:C++ ParseElementChildren函数的具体用法?C++ ParseElementChildren怎么用?C++ ParseElementChildren使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ParseElementChildren函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ParseElement
mDNSlocal mDNSBool ParseElement(xmlDocPtr tadoc, xmlNode * a_node, TrustAnchor *ta)
{
xmlNode *cur_node = NULL;
for (cur_node = a_node; cur_node; cur_node = cur_node->next)
{
if (cur_node->type == XML_ELEMENT_NODE)
{
// There could be multiple KeyDigests per TrustAnchor. We keep parsing till we
// reach the last one or we encounter an error in parsing the document.
if (!xmlStrcmp(cur_node->name, (const xmlChar *)"KeyDigest"))
{
if (ta->rds.digest)
mDNSPlatformMemFree(ta->rds.digest);
ta->rds.digestType = 0;
ta->digestLen = 0;
}
if (!ParseElementChildren(tadoc, cur_node->children, ta))
return mDNSfalse;
if (!ParseElement(tadoc, cur_node->children, ta))
return mDNSfalse;
}
}
return mDNStrue;
}
开发者ID:RomainQuidet,项目名称:mDNSResponder,代码行数:25,代码来源:DNSSECSupport.c
示例2: snprintf
bool ClassDecodeGenerator::ProcessObjectInline( const TiXmlElement* field )
{
char iname[16];
snprintf( iname, sizeof( iname ), "obj_%u", mItemNumber++ );
//make sure its an object
const char* v = top();
fprintf( mOutputFile,
" if( !%s->IsObject() )\n"
" {\n"
" _log( NET__PACKET_ERROR, \"Decode %s failed: %s is the wrong type: %%s\", %s->TypeString() );\n"
"\n"
" return false;\n"
" }\n"
" PyObject* %s = %s->AsObject();\n"
"\n",
v,
mName, iname, v,
iname, v
);
char aname[32];
snprintf( aname, sizeof( aname ), "%s->arguments()", iname );
push( aname );
char tname[32];
snprintf( tname, sizeof( tname ), "%s->type()", iname );
push( tname );
if( !ParseElementChildren( field, 2 ) )
return false;
pop();
return true;
}
开发者ID:Almamu,项目名称:evemu_apocrypha,代码行数:35,代码来源:DecodeGenerator.cpp
示例3: _log
bool ClassCloneGenerator::ProcessElementDef( const TiXmlElement* field )
{
const char* name = field->Attribute( "name" );
if( name == NULL )
{
_log( COMMON__ERROR, "<element> at line %d is missing the name attribute, skipping.", field->Row() );
return false;
}
fprintf( mOutputFile,
"%s& %s::operator=( const %s& oth )\n"
"{\n",
name, name, name
);
if( !ParseElementChildren( field ) )
return false;
fprintf( mOutputFile,
" return *this;\n"
"}\n"
"\n"
);
return true;
}
开发者ID:AlTahir,项目名称:Apocrypha_combo,代码行数:26,代码来源:CloneGenerator.cpp
示例4: _log
bool ClassDumpGenerator::ProcessElementDef( const TiXmlElement* field )
{
const char* name = field->Attribute( "name" );
if( name == NULL )
{
_log( COMMON__ERROR, "<element> at line %d is missing the name attribute, skipping.", field->Row() );
return false;
}
fprintf( mOutputFile,
"void %s::Dump( LogType l_type, const char* pfx ) const\n"
"{\n"
" _log( l_type, \"%%s%s\", pfx );\n"
"\n",
name, name
);
if( !ParseElementChildren( field ) )
return false;
fprintf( mOutputFile,
"}\n"
"\n"
);
return true;
}
开发者ID:Almamu,项目名称:evemu_apocrypha,代码行数:27,代码来源:DumpGenerator.cpp
示例5: fprintf
bool ClassDumpGenerator::ProcessObjectInline( const TiXmlElement* field )
{
fprintf( mOutputFile,
" _log( l_type, \"%%sObject:\", pfx );\n"
"\n"
);
return ParseElementChildren( field, 2 );
}
开发者ID:Almamu,项目名称:evemu_apocrypha,代码行数:9,代码来源:DumpGenerator.cpp
示例6: AddValueParser
bool EVEServerConfig::ProcessCharacter( const TiXmlElement* ele )
{
AddValueParser( "startBalance", character.startBalance );
const bool result = ParseElementChildren( ele );
RemoveParser( "startBalance" );
return result;
}
开发者ID:Bes666,项目名称:Evemu,代码行数:10,代码来源:EVEServerConfig.cpp
示例7: while
bool ClassDecodeGenerator::ProcessTupleInline( const TiXmlElement* field )
{
//first, we need to know how many elements this tuple has:
const TiXmlNode* i = NULL;
uint32 count = 0;
while( ( i = field->IterateChildren( i ) ) )
{
if( i->Type() == TiXmlNode::ELEMENT )
count++;
}
char iname[16];
snprintf( iname, sizeof( iname ), "tuple%u", mItemNumber++ );
const char* v = top();
//now we can generate the tuple decl
fprintf( mOutputFile,
" if( !%s->IsTuple() )\n"
" {\n"
" _log( NET__PACKET_ERROR, \"Decode %s failed: %s is the wrong type: %%s\", %s->TypeString() );\n"
"\n"
" return false;\n"
" }\n"
" PyTuple* %s = %s->AsTuple();\n"
"\n"
" if( %s->size() != %u )\n"
" {\n"
" _log( NET__PACKET_ERROR, \"Decode %s failed: %s is the wrong size: expected %d, but got %%lu\", %s->size() );\n"
"\n"
" return false;\n"
" }\n"
"\n",
v,
mName, iname, v,
iname, v,
iname, count,
mName, iname, count, iname
);
//now we need to queue up all the storage locations for the fields
//need to be backward
char varname[64];
while( count-- > 0 )
{
snprintf( varname, sizeof( varname ), "%s->GetItem( %u )", iname, count );
push( varname );
}
if( !ParseElementChildren( field ) )
return false;
pop();
return true;
}
开发者ID:Almamu,项目名称:evemu_apocrypha,代码行数:55,代码来源:DecodeGenerator.cpp
示例8: AddValueParser
bool EVEServerConfig::ProcessAccount( const TiXmlElement* ele )
{
AddValueParser( "autoAccountRole", account.autoAccountRole );
AddValueParser( "loginMessage", account.loginMessage );
const bool result = ParseElementChildren( ele );
RemoveParser( "autoAccountRole" );
RemoveParser( "loginMessage" );
return result;
}
开发者ID:Camwarp,项目名称:evemu_server,代码行数:12,代码来源:EVEServerConfig.cpp
示例9: AddValueParser
bool EVEServerConfig::ProcessRates( const TiXmlElement* ele )
{
AddValueParser( "skillRate", rates.skillRate );
AddValueParser( "secRate", rates.secRate );
AddValueParser( "npcBountyMultiply", rates.npcBountyMultiply );
const bool result = ParseElementChildren( ele );
RemoveParser( "skillRate" );
RemoveParser( "secRate" );
RemoveParser( "npcBountyMultiply" );
return result;
}
开发者ID:Haplo7707,项目名称:evemu_incursion,代码行数:14,代码来源:EVEServerConfig.cpp
示例10: strerror
bool XMLPacketGen::ParseElements( const TiXmlElement* field )
{
if( !OpenFiles() )
{
sLog.Error( "XMLPacketGen", "Unable to open output files: %s.", strerror( errno ) );
return false;
}
const std::string def = FNameToDef( mHeaderFileName.c_str() );
//headers:
fprintf( mHeaderFile,
"%s\n"
"\n"
"#ifndef %s\n"
"#define %s\n"
"\n"
"#include \"python/PyVisitor.h\"\n"
"#include \"python/PyRep.h\"\n"
"\n",
smGenFileComment,
def.c_str(),
def.c_str()
);
fprintf( mSourceFile,
"%s\n"
"\n"
"#include \"EVECommonPCH.h\"\n"
"\n"
"#include \"%s\"\n"
"\n",
smGenFileComment,
mHeaderFileName.c_str()
);
//content
bool res = ParseElementChildren( field );
//footers:
fprintf( mHeaderFile,
"#endif /* !%s */\n"
"\n",
def.c_str()
);
return res;
}
开发者ID:Almamu,项目名称:evemu_apocrypha,代码行数:47,代码来源:XMLPacketGen.cpp
示例11: AddMemberParser
bool EVEServerConfig::ProcessEveServer( const TiXmlElement* ele )
{
// entering element, extend allowed syntax
AddMemberParser( "account", &EVEServerConfig::ProcessAccount );
AddMemberParser( "character", &EVEServerConfig::ProcessCharacter );
AddMemberParser( "database", &EVEServerConfig::ProcessDatabase );
AddMemberParser( "files", &EVEServerConfig::ProcessFiles );
AddMemberParser( "net", &EVEServerConfig::ProcessNet );
// parse the element
const bool result = ParseElementChildren( ele );
// leaving element, reduce allowed syntax
RemoveParser( "account" );
RemoveParser( "character" );
RemoveParser( "database" );
RemoveParser( "files" );
RemoveParser( "net" );
// return status of parsing
return result;
}
开发者ID:Bes666,项目名称:Evemu,代码行数:22,代码来源:EVEServerConfig.cpp
示例12: ParseElementChildren
bool ClassDumpGenerator::ProcessSubStreamInline( const TiXmlElement* field )
{
//do we want to display the substream in the dump?
return ParseElementChildren( field, 1 );
}
开发者ID:Almamu,项目名称:evemu_apocrypha,代码行数:5,代码来源:DumpGenerator.cpp
示例13: ParseElementChildren
bool ClassHeaderGenerator::ProcessTupleInline( const TiXmlElement* field )
{
return ParseElementChildren( field );
}
开发者ID:Almamu,项目名称:evemu_apocrypha,代码行数:4,代码来源:HeaderGenerator.cpp
示例14: ParseElementChildren
bool ClassConstructGenerator::ProcessListInline( const TiXmlElement* field )
{
return ParseElementChildren( field );
}
开发者ID:Almamu,项目名称:evemu_crucible,代码行数:4,代码来源:ConstructGenerator.cpp
示例15: ParseElementChildren
bool ClassCloneGenerator::ProcessDictInline( const TiXmlElement* field )
{
return ParseElementChildren( field );
}
开发者ID:AlTahir,项目名称:Apocrypha_combo,代码行数:4,代码来源:CloneGenerator.cpp
示例16: ParseElementChildren
bool ClassDestructGenerator::ProcessObjectInline( const TiXmlElement* field )
{
return ParseElementChildren( field, 2 );
}
开发者ID:AlTahir,项目名称:Apocrypha_combo,代码行数:4,代码来源:DestructGenerator.cpp
注:本文中的ParseElementChildren函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论