• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ parseNode函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中parseNode函数的典型用法代码示例。如果您正苦于以下问题:C++ parseNode函数的具体用法?C++ parseNode怎么用?C++ parseNode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: parseNode

bool Config::parseNode(const pugi::xml_node& node) {
    UnicodeString currentPath = StringConverter::fromUtf8(node.path('/'));
    currentPath.append("@");

    pugi::xml_node::attribute_iterator attrIter = node.attributes_begin();
    pugi::xml_node::attribute_iterator attrEnd = node.attributes_end();

    for (; attrIter != attrEnd; ++attrIter) {
        UnicodeString configKey = currentPath;
        configKey.append(attrIter->name());
        std::map<UnicodeString, Variable>::iterator itm = variablesMap_.find(configKey);
        if (itm != variablesMap_.end()) {
            if (!itm->second.parse(attrIter->value())) {
                return false;
            }
        } else {
            LOG_WARN << "Ignoring unknown config value " << configKey << std::endl;
        }
    }

    pugi::xml_node::iterator nodeIter = node.begin();
    pugi::xml_node::iterator nodeEnd = node.end();

    for (; nodeIter != nodeEnd; ++nodeIter) {
        if (nodeIter->type() == pugi::node_element) {
            if (!parseNode(*nodeIter)) {
                return false;
            }
        }
    }

    return true;
}
开发者ID:abnr,项目名称:fluorescence,代码行数:33,代码来源:config.cpp


示例2: Group

Group * AssimpLoader::parseNode(const aiScene & scene,
    const QList<PolygonalDrawable *> &drawables, const aiNode & node) const
{
    Group * group = new Group(node.mName.C_Str());

    const aiMatrix4x4 & mat = node.mTransformation;
    glm::mat4 transform(
        mat.a1, mat.b1, mat.c1, mat.d1,
        mat.a2, mat.b2, mat.c2, mat.d2,
        mat.a3, mat.b3, mat.c3, mat.d3,
        mat.a4, mat.b4, mat.c4, mat.d4
    );
    /*
    translation vector is marked with []
    assimp's aiMatrix4x4 : row major (as usually written down in maths)
     a1  a2  a3 [a4]  <1. row>
     b1  b2  b3 [b4]  <2. row>
     c1  c2  c3 [c4]  <3. row>
     d1  d2  d3  d4   <4. row>
    glm/openGL mat4 : column major (not as stated in http://assimp.sourceforge.net/lib_html/data.html , search for "All matrices")
     a1  b1  c1  d1   <1. column>
     a2  b2  c2  d2   <2. column>
     a3  b3  c3  d3   <3. column>
    [a4][b4][c4] d4   <4. column>
    */
    group->setTransform(transform);

    for (unsigned int i = 0; i < node.mNumChildren; i++)
        group->append(parseNode(scene, drawables, *(node.mChildren[i])));

    for (unsigned int i = 0; i < node.mNumMeshes; i++)
        group->append(drawables[node.mMeshes[i]]);

    return group;
}
开发者ID:hpicgs,项目名称:cgsee,代码行数:35,代码来源:assimploader.cpp


示例3: while

inline void PBFParser::ParseData() {
    while (true) {
        _ThreadData *threadData;
        threadDataQueue->wait_and_pop(threadData);
        if( NULL==threadData ) {
            INFO("Parse Data Thread Finished");
            threadDataQueue->push(NULL); // Signal end of data for other threads
            break;
        }

        loadBlock(threadData);

        for(int i = 0, groupSize = threadData->PBFprimitiveBlock.primitivegroup_size(); i < groupSize; ++i) {
            threadData->currentGroupID = i;
            loadGroup(threadData);

            if( parsingStep == eRelations ) {
                if(threadData->entityTypeIndicator == TypeRelation)
                    parseRelation(threadData);
            } else if( parsingStep == eOther ) {
                if(threadData->entityTypeIndicator == TypeNode)
                    parseNode(threadData);
                if(threadData->entityTypeIndicator == TypeWay)
                    parseWay(threadData);
                if(threadData->entityTypeIndicator == TypeDenseNode)
                    parseDenseNode(threadData);
            }
        }

        delete threadData;
        threadData = NULL;
    }
}
开发者ID:ibikecph,项目名称:osrm-backend,代码行数:33,代码来源:PBFParser.cpp


示例4: parseNode

void parseNode(QDomNode &node,QMap<QString, QString> *retmap)
{
    if (node.isNull() || !node.isElement())
    {
      return;
    }
    QDomElement elem = node.toElement();
    if(node.firstChild().isElement())
    {
        QDomNodeList children=node.childNodes();
        int c=children.count();
        for(int i=0;i<c;i++)
        {
            QDomNode cn=children.item(i);
            parseNode(cn,retmap);

        }
        return;
    }
    QString tagname=node.toElement().tagName();
    int pos=tagname.indexOf(":");
    if(pos >=0)
    {
        tagname=tagname.right(tagname.length() - pos - 1);
    }
    retmap->insert(tagname,node.toElement().text());

}
开发者ID:SiteView,项目名称:genieautorun,代码行数:28,代码来源:SvtSoap.cpp


示例5: mainParse

Children mainParse(I& be, I& en,  Pos& pos) {
	Children ret;

	while(be != en) {
		eatWhitespaceComment(be, en, pos);

		if(test(be, en, "<{{")) {
			ret.push_back(std::move(parseC(be, en, pos)));	
		} else if(test(be, en, '<')) {
			ret.push_back(std::move(parseNode(be, en, pos)));
		} else if(test(be, en, '>')) {
			eat(be, '>', pos);
			break;
		} else {
			I iter;
			TNodeType type;	
			if(!test(be, en, "&{{") && *be == '&') {
		   		iter = eatUntil(be, en, "\n", pos);
				/*for(iter = be; !test(iter, en, '\n') && !test(iter, en, "//"); 
						increment(iter, pos)) 
				{
				}
				if(test(be, en, "//")) {
					eatWhitespaceComment(be, en, pos);
				}*/
				type = TNodeType::SingleCppLine;
			} else {
		   		iter = eatUntil(be, en, "\n>", pos);
				for(iter = be; 
					!test(iter, en, '\n') && !test(iter, en, "//") && !test(iter, en, '>'); 
					increment(iter, pos)) 
				{
				}
				if(test(be, en, "//")) {
					eatWhitespaceComment(be, en, pos);
				}
				type = TNodeType::Text;
			}
			auto posCopy = pos;
			//std::cout<<"||| "<<std::string(be, iter)<<std::endl;
			ret.push_back(
				std::make_unique<TNode>(std::string(be, iter), posCopy, type
				)
			);

			be = iter;

			char iterC = *iter;
			eat(be, iterC, pos);

			if(iterC == '>') 
			{
				break;
			}
		}
		eatWhitespaceComment(be, en, pos);
	}

	return ret;
}
开发者ID:adderly,项目名称:sweet.hpp,代码行数:60,代码来源:amber.cpp


示例6: fopen

bool FileLoader::openFile(const char* filename, bool write, bool caching /*= false*/)
{
	if(write) {
		m_file = fopen(filename, "wb");
		if(m_file) {
			uint32_t version = 0;
			writeData(&version, sizeof(version), false);
			return true;
		}
		else{
			m_lastError = ERROR_CAN_NOT_CREATE;
			return false;
		}
	}
	else {
		m_file = fopen(filename, "rb");
		if(m_file){
			uint32_t version;
			fread(&version, sizeof(version), 1, m_file);
			if(version > 0){
				fclose(m_file);
				m_file = NULL;
				m_lastError = ERROR_INVALID_FILE_VERSION;
				return false;
			}
			else{
				if(caching){
					m_use_cache = true;
					fseek(m_file, 0, SEEK_END);
					int file_size = ftell(m_file);
					m_cache_size = std::min(32768, std::max(file_size/20, 8192)) & ~0x1FFF;
				}
				
				//parse nodes
				if(safeSeek(4)){
					delete m_root;
					m_root = new NodeStruct();
					m_root->start = 4;
					int byte;
					if(safeSeek(4) && readByte(byte) && byte == NODE_START){
						bool ret = parseNode(m_root);
						return ret;
					}
					else{
						return false;
					}
				}
				else{
					m_lastError = ERROR_INVALID_FORMAT;
					return false;
				}
			}
		}
		else{
			m_lastError = ERROR_CAN_NOT_OPEN;
			return false;
		}
	}
}
开发者ID:WeDontGiveAF,项目名称:OOServer,代码行数:59,代码来源:fileloader.cpp


示例7: BmlDecoder

 BmlDecoder (FILE * fp) {
     m_fp = fp;
     //m_table = new Table ();
     m_nbTags = 0;
     m_root = NULL;
     parseTable ();
     m_root = parseNode ();
 }
开发者ID:jperrot,项目名称:MeMoPlayer,代码行数:8,代码来源:bml.cpp


示例8: setData

	void XMLDecoder::parse( XMLDocument* doc, const void* data, size_t len )
	{
		setData( data, len );
		XMLNode* node = parseDeclaration();
		doc->addNode( node );
		while( ( node = parseNode() ) != NULL )
			doc->addNode( node );
	}
开发者ID:MajorBreakfast,项目名称:cvt,代码行数:8,代码来源:XMLDecoder.cpp


示例9: ios_plist_to_table

int ios_plist_to_table(lua_State* L, plist_t iconState)
{
  lua_newtable(L);
  parseNode(L, iconState, 0);
  lua_rawgeti(L, -1, 1);
  lua_remove(L, -2);
  return 1;
}
开发者ID:gdawg,项目名称:ios-icons,代码行数:8,代码来源:sb_ios2lua.c


示例10: while

// -------------------------------------------------------------------------------
void XMLPersister::parseChildrenOf( QDomNode& node, CTreeInformationElement& parent )
// -------------------------------------------------------------------------------
{
   QDomNode child = node.firstChild();
   while ( !child.isNull() )
   {
      parseNode(child, parent);
      child = child.nextSibling();
   }
}
开发者ID:amitch,项目名称:tuxcards,代码行数:11,代码来源:xmlpersister.cpp


示例11: parseNode

void TreeWalker::parseTypeSpecifier(TypeSpecifierAST *node)
{
    parseNode(node->name());
    parseNode(node->cvQualify());
    parseNode(node->cv2Qualify());

    switch (node->nodeType()) {
    case NodeType_ClassSpecifier:
        parseClassSpecifier(static_cast<ClassSpecifierAST*>(node));
        break;
    case NodeType_EnumSpecifier:
        parseEnumSpecifier(static_cast<EnumSpecifierAST*>(node));
        break;
    case NodeType_ElaboratedTypeSpecifier:
        parseElaboratedTypeSpecifier(static_cast<ElaboratedTypeSpecifierAST*>(node));
        break;
    default:
        break;
    }
}
开发者ID:Suneal,项目名称:qt,代码行数:20,代码来源:treewalker.cpp


示例12: node

node* parser::parse ( Stream& istr )
{
  if ( ! istr.good () )
  return 0;

  node* pRoot = new node ( istr );

  parseNode ( istr, pRoot );

  return pRoot;
}
开发者ID:prwhite,项目名称:philibs,代码行数:11,代码来源:sceneaseparser.cpp


示例13: parseNode

void Van::init() {
  scheduler_ = parseNode(FLAGS_scheduler);
  myNode_ = parseNode(FLAGS_my_node);
  LOG(INFO) << "I'm \n[" << myNode_.DebugString() << "]";

  context_ = zmq_ctx_new();
  CHECK(context_ != nullptr) << "Create 0mq context failed";

  zmq_ctx_set(context_, ZMQ_MAX_SOCKETS, 65536);
  bind();
  connect(scheduler_);

  if (isScheduler()) {
    CHECK(!zmq_socket_monitor(receiver_, "inproc://monitor", ZMQ_EVENT_ALL));
  } else {
    CHECK(!zmq_socket_monitor(senders_[scheduler_.id()], "inproc://monitor",
                              ZMQ_EVENT_ALL));
  }
  monitorThread_ = new std::thread(&Van::monitor, this);
  monitorThread_->detach();
}
开发者ID:lacozhang,项目名称:numopt,代码行数:21,代码来源:van.cpp


示例14: parseNode

// загрузка из файла
bool Item::load(QFile *file)
{
    QDomDocument doc;
    if (!doc.setContent(file->readAll())) return false;

    QDomElement docElem = doc.documentElement();

    // переходим к парсингу
    parseNode(docElem);

    return true;
}
开发者ID:kirik88,项目名称:journal2,代码行数:13,代码来源:item.cpp


示例15: loadXMLFile

//Reads in the file passed in and returns it as an XML node
XMLNode *xmlRead(char* file)
{
	chrPtr = 0;
  loadXMLFile(file);
  XMLNode *docNode = xmlCreateNode(DOCUMENT_NODE, DOCUMENT_NAME, NULL); 
  
  parseNode(docNode);
  
  free(xmlArray);
 
  return docNode;
}
开发者ID:mjones112000,项目名称:DistributedApplicationDebugger,代码行数:13,代码来源:xmlReader.c


示例16: switch

/**
 * Parses a regular expression string and builds a regular expression
 * tree. The root node of that tree is returned.
 * @param string The regular expression string.
 * @param pos The position of the parser in the regular expression.
 * @param len The length of the whole regular expression string.
 * @return The root node of the expression tree.
 * @author Daniel Dreibrodt, Konstantin Steinmiller
 */
RETreeNode *REReaderWriter::parseNode(const char string[], int *pos, int len) {
	if(*pos>=len) {
		//end of string reached
		return NULL;
	}
    switch(string[*pos]) {
    	case '(' : {
    		(*pos)++;
    		RETreeNode *groupNode = parseNode(string, pos, len);
    		return parseNode(groupNode, string, pos, len);
    		break;
    	}
    	case ')' : {
    		throw "Read ')' but that is not allowed here!";
    		break;
    	}
    	case '|' : {
    		throw "Read '|' but that is not allowed here!";
    		break;
    	}
    	case '.' : {
    		throw "Read '.' but that is not allowed here!";
    		break;
    	}
    	case '*' : {
    		throw "Read '*' but that is not allowed here!";
    		break;
    	}
    	case ' ' : {
    		(*pos)++;
    		return parseNode(string, pos, len);
    		break;
    	}
    	default : {
    		RETreeNode *lit = parseLiteral(string,pos,len);
			return parseNode(lit, string, pos, len);
    		break;
    	}
    }
}
开发者ID:3breadt,项目名称:UPB-ADT-Automata-Tools,代码行数:49,代码来源:RE_ReaderWriter.cpp


示例17: parseNode

EntityVector Serializer::deserialize()
{
	EntityVector entities;
	QDomNodeList nodes = mDomElement.elementsByTagName(nodeKey);
	for (unsigned i = 0; i < nodes.length(); i++)
	{
		QDomNode node = nodes.at(i);
		QDomElement element = node.toElement();
		Entity entity = parseNode(element);
		entities.push_back(entity);
	}
	return entities;
}
开发者ID:AirVan21,项目名称:tools,代码行数:13,代码来源:serializer.cpp


示例18: Sequence

SgfSequence * Parser::parseSequence(QIODevice & in) {
    SgfSequence * sequence = new Sequence();
    SgfNode * node;
    try {
        while (node = parseNode(in)) {
            sequence->addNode(node);
        }
    } catch (...) {
        delete node;
        delete sequence;
        throw;
    }
}
开发者ID:palawijaGit,项目名称:kockandur,代码行数:13,代码来源:parser_main.cpp


示例19: while

/*
 * Begin: Parse pwman3 XML Files.
 */
void KeePassXmlStreamReader::parsePwmanList(){
    groupTitle = "pwman3";

    while(xmlReader.readNextStartElement()){
        if(xmlReader.name() == "Node"){
            qDebug("Found Node in pwman3 XML list.");
            parseNode();
        }else{
            qDebug("Skipping pwman3 XML list child element: %s", xmlReader.name().toString().toUtf8().constData());
            xmlReader.skipCurrentElement();
        }
    }
    qDebug("Leaving parsePwmanList...");
}
开发者ID:miurahr,项目名称:meepasswords,代码行数:17,代码来源:keepassxmlstreamreader.cpp


示例20: i18n

StructureDataInformation* OsdParser::structFromXML(const QDomElement& xmlElem)
{
    QString name = xmlElem.attribute(QLatin1String("name"), i18n("<invalid name>"));
    StructureDataInformation* stru = new StructureDataInformation(name);
    QDomNode node = xmlElem.firstChild();
    while (!node.isNull())
    {
        DataInformation* data = parseNode(node, stru);
        if (data)
            stru->addDataTypeToStruct(data);
        node = node.nextSibling();
    }
    return stru;
}
开发者ID:ShermanHuang,项目名称:kdesdk,代码行数:14,代码来源:osdparser.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ parseNs函数代码示例发布时间:2022-05-30
下一篇:
C++ parseMessage函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap