Пример #1
0
void Bank::createFromXml( istringstream& is, ProgramList& list )
{
    Document doc;
    try
    {
	    doc.Parse( is.str(), true );

        Node* moduleNode = doc.FirstChild( "Module", false );
        if( moduleNode != NULL )
        {
            Program* program = new Program();
            createFromXml( is, *program );
            list.push_back( program );
        }
        else {

	        Iterator< Element > it( "Program" );
	        for( it = it.begin( &doc ); it != it.end(); it++ )
	        {
		        Program* program = new Program();
		        Element* programElement = it.Get();
		        readProgram( programElement, program );

		        list.push_back( program );
	        }
        }
    }
    catch( const exception& e ) {
        TRACE( e.what() );
    }
}
Пример #2
0
/*---------------------------------------------------------------------*//**
	XMLから作成
**//*---------------------------------------------------------------------*/
bool Menu::create(u32 fileidXml, MenuFuncTable* functblRef, MenuPanelFactory* pnlfctryRef, void* objCreateParam)
{
	TRACE(VcString::format("{Menu.Create} read : fileid=%d\n", fileidXml));

	// ファイルを読む
	IdFile file(fileidXml);
	if(!file.isOpened())	{	ASSERT(false);	return false;	}

	// XML から作成
	bool isSucceeded = createFromXml(&file, functblRef, pnlfctryRef, objCreateParam);

	// ファイルを閉じる
	file.close();

	return isSucceeded;
}
Пример #3
0
	void Cell::init(XML* xml){
		Parent::init(xml);
		createFromXml(xml);
	}