当前位置: 首页>>代码示例>>C++>>正文


C++ TextReader::get_attribute方法代码示例

本文整理汇总了C++中xmlpp::TextReader::get_attribute方法的典型用法代码示例。如果您正苦于以下问题:C++ TextReader::get_attribute方法的具体用法?C++ TextReader::get_attribute怎么用?C++ TextReader::get_attribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xmlpp::TextReader的用法示例。


在下文中一共展示了TextReader::get_attribute方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: agregarArista

/*----------------------------------------------------------------------------*/
void XmlParser::agregarArista(Mapa* mapa,xmlpp::TextReader& reader)
{
	int arcoId=-1;	
	
	string orientacion = reader.get_attribute (ATRIB_ORIENTACION);
	arcoId=getAtributoInt(reader,ATRIB_ID);
	cargarArista(mapa,reader,arcoId,orientacion);
}
开发者ID:nicosuarez,项目名称:pacmantaller,代码行数:9,代码来源:XmlParser.cpp

示例2: cargarMundo

/*----------------------------------------------------------------------------*/
void XmlParser::cargarMundo(Mundo* mundo,xmlpp::TextReader& reader)
{
	do
    {   	
		buscarElemento(reader);
		string path = reader.get_attribute(ATRIB_PATH);
		if(path!="")
		{
			mundo->getNiveles()->push(path);
		}	
    }while(reader.read());
}
开发者ID:nicosuarez,项目名称:pacmantaller,代码行数:13,代码来源:XmlParser.cpp

示例3: get_attribute

inline bool get_attribute(T &res,
                          xmlpp::TextReader &reader,
                          const str &eltname)
{
    str val(reader.get_attribute(eltname));


    if(!val.empty()) {
       std::istringstream str_in(val);
       str_in >> res;

       return true;
    }
开发者ID:persimmon2014,项目名称:Roadie-dev,代码行数:13,代码来源:xml_util.hpp

示例4: agregarElementos

/*----------------------------------------------------------------------------*/
void XmlParser::agregarElementos(Mapa* mapa,xmlpp::TextReader& reader)
{
	do
    {   
		string tipoElemento = reader.get_attribute(ATRIB_TIPO);
		if(tipoElemento==POWER_UP)
			agregarPowerUp(mapa,reader);
		if(tipoElemento==BONUS)
			agregarBonus(mapa,reader);
		if(tipoElemento==CASA_FANTASMAS)
			agregarCasaFantasmas(mapa,reader);
		if(tipoElemento==SALIDA_PACMAN)
			agregarSalidaPacMan(mapa,reader);
				
    }while(reader.read());
	
	//Se agregan las pantillas al mapa
	agregarPastillas(mapa);
}
开发者ID:nicosuarez,项目名称:pacmantaller,代码行数:20,代码来源:XmlParser.cpp

示例5: agregarCasaFantasmas

/*----------------------------------------------------------------------------*/
void XmlParser::agregarCasaFantasmas(Mapa* mapa,xmlpp::TextReader& reader)
{
	int idVertice=0;
	int idPuerta = getAtributoInt(reader,ATRIB_ID_VERTICE);
	tVecVerticeId vertices; 
	elementosNoPastillas.push_back(idPuerta);

	for(int i=1;i<7;i++)
	{
		idVertice=getAtributoInt(reader,ATRIB_ID_VERTICE+StrToken::intToString(i));
		elementosNoPastillas.push_back(idVertice);
		vertices.push_back(idVertice);

	}	
	string orientacion=reader.get_attribute(ATRIB_ORIENTACION);
	CasaFantasmas casaFantasmas(idPuerta,orientacionParser(orientacion));
	casaFantasmas.setVerticesId(vertices);
	Modelo::getInstance()->SetCasaFantasmas(casaFantasmas);
}
开发者ID:nicosuarez,项目名称:pacmantaller,代码行数:20,代码来源:XmlParser.cpp

示例6: getAtributoInt

/*----------------------------------------------------------------------------*/
int XmlParser::getAtributoInt(xmlpp::TextReader& reader,string atrib)
{
	int intValor=-1;
	StrToken::stringTo<int>(intValor,reader.get_attribute (atrib));	
	return intValor;
}
开发者ID:nicosuarez,项目名称:pacmantaller,代码行数:7,代码来源:XmlParser.cpp


注:本文中的xmlpp::TextReader::get_attribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。