本文整理汇总了C++中ParseElementChildren函数的典型用法代码示例。如果您正苦于以下问题:C++ ParseElementChildren函数的具体用法?C++ ParseElementChildren怎么用?C++ ParseElementChildren使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ParseElementChildren函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例5: fprintf
bool ClassDumpGenerator::ProcessObjectInline( const TiXmlElement* field )
{
fprintf( mOutputFile,
" _log( l_type, \"%%sObject:\", pfx );\n"
"\n"
);
return ParseElementChildren( field, 2 );
}
示例6: AddValueParser
bool EVEServerConfig::ProcessCharacter( const TiXmlElement* ele )
{
AddValueParser( "startBalance", character.startBalance );
const bool result = ParseElementChildren( ele );
RemoveParser( "startBalance" );
return result;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例12: ParseElementChildren
bool ClassDumpGenerator::ProcessSubStreamInline( const TiXmlElement* field )
{
//do we want to display the substream in the dump?
return ParseElementChildren( field, 1 );
}
示例13: ParseElementChildren
bool ClassHeaderGenerator::ProcessTupleInline( const TiXmlElement* field )
{
return ParseElementChildren( field );
}
示例14: ParseElementChildren
bool ClassConstructGenerator::ProcessListInline( const TiXmlElement* field )
{
return ParseElementChildren( field );
}
示例15: ParseElementChildren
bool ClassCloneGenerator::ProcessDictInline( const TiXmlElement* field )
{
return ParseElementChildren( field );
}