Exemple #1
0
/* Add a an already existing parser to the default list. As usual, order
 * of calls is important (most importantly, that means the legacy parser,
 * which can process everything, MUST be added last!).
 * rgerhards, 2009-11-04
 */
static rsRetVal
AddDfltParser(uchar *pName)
{
	parser_t *pParser;
	DEFiRet;

	CHKiRet(FindParser(&pParser, pName));
	CHKiRet(AddParserToList(&pDfltParsLst, pParser));
	DBGPRINTF("Parser '%s' added to default parser set.\n", pName);
	
finalize_it:
	RETiRet;
}
Exemple #2
0
bool MsgGenFactory::Parse(const char* pszFile, const char* pszOutDir)
{
	TiXmlDocument doc(pszFile);
	doc.LoadFile();
	if(doc.Error()) return false;

	TiXmlElement* pElmRoot = doc.RootElement();
	if (!pElmRoot) return false;

	IMsgGen* pMsgGen = FindParser(pElmRoot->Value());
	if (!pMsgGen) return false;

	return pMsgGen->Parse(pElmRoot, pszOutDir);
}