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

C++ parseAttributes函数代码示例

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

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



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

示例1: setResult

void GUI::YuvFileOpenDialog::hasFinished(int result) {
	if(result==QDialog::Accepted) {
		int selectedindex=-1;
		if(!listView_recentlyUsed_->selectionModel()->selectedIndexes().isEmpty()) {
			selectedindex=listView_recentlyUsed_->selectionModel()->selectedIndexes().first().row();
		}

		QString fileattributes;
		if(selectedindex!=-1&&getFilename()==getListModel()->stringList().at(selectedindex)) {
			bool res=parseAttributes(attributes_[selectedindex]);

			if(!res) {
				if((fileattributes=askAttributes()).isEmpty()) {
					setResult(QDialog::Rejected);
					return;
				}
			} else {
				fileattributes=attributes_[selectedindex];
			}
		} else {
			if(getFilename().isEmpty()||(fileattributes=askAttributes()).isEmpty()) {
				setResult(QDialog::Rejected);
				return;
			}
		}
		parseAttributes(fileattributes);
		saveListModel(getFilename(),fileattributes);
	}
}
开发者ID:SuppenGeist,项目名称:pse-ws1516-videoencoder-ta,代码行数:29,代码来源:YuvFileOpenDialog.cpp


示例2: parseAttributes

bool ProcessingInstruction::checkStyleSheet(String& href, String& charset)
{
    if (m_target != "xml-stylesheet" || !document().frame() || parentNode() != document())
        return false;

    // see http://www.w3.org/TR/xml-stylesheet/
    // ### support stylesheet included in a fragment of this (or another) document
    // ### make sure this gets called when adding from javascript
    bool attrsOk;
    const HashMap<String, String> attrs = parseAttributes(m_data, attrsOk);
    if (!attrsOk)
        return false;
    HashMap<String, String>::const_iterator i = attrs.find("type");
    String type;
    if (i != attrs.end())
        type = i->value;

    m_isCSS = type.isEmpty() || type == "text/css";
    m_isXSL = (type == "text/xml" || type == "text/xsl" || type == "application/xml" || type == "application/xhtml+xml" || type == "application/rss+xml" || type == "application/atom+xml");
    if (!m_isCSS && !m_isXSL)
        return false;

    href = attrs.get("href");
    charset = attrs.get("charset");
    String alternate = attrs.get("alternate");
    m_alternate = alternate == "yes";
    m_title = attrs.get("title");
    m_media = attrs.get("media");

    return !m_alternate || !m_title.isEmpty();
}
开发者ID:howardroark2018,项目名称:chromium,代码行数:31,代码来源:ProcessingInstruction.cpp


示例3: PROFILE_SCOPE

inline bool TamlXmlParser::parseElement( TiXmlElement* pXmlElement, TamlVisitor& visitor )
{
    // Debug Profiling.
    PROFILE_SCOPE(TamlXmlParser_ParseElement);

    // Parse attributes (stop processing if instructed).
    if ( !parseAttributes( pXmlElement, visitor ) )
        return false;

    // Finish if only the root is needed.
    if ( visitor.wantsRootOnly() )
        return false;

    // Fetch any children.
    TiXmlNode* pChildXmlNode = pXmlElement->FirstChild();

    // Do we have any element children?
    if ( pChildXmlNode != NULL && pChildXmlNode->Type() == TiXmlNode::TINYXML_ELEMENT )
    {
        // Iterate children.
        for ( TiXmlElement* pChildXmlElement = dynamic_cast<TiXmlElement*>( pChildXmlNode ); pChildXmlElement; pChildXmlElement = pChildXmlElement->NextSiblingElement() )
        {
            // Parse element (stop processing if instructed).
            if ( !parseElement( pChildXmlElement, visitor ) )
                return false;
        }
    }

    return true;
}
开发者ID:03050903,项目名称:Torque3D,代码行数:30,代码来源:tamlXmlParser.cpp


示例4: sdp

      //-----------------------------------------------------------------------
      ISDPTypes::SDPPtr SDPParser::parse(const char *blob)
      {
        if (!blob) return SDPPtr();

        SDPPtr sdp(make_shared<SDP>());

        sdp->mOriginal = String(blob);
        std::unique_ptr<char[]> rawBuffer(new char[sdp->mOriginal.length()+1]);
        sdp->mRawBuffer = std::move(rawBuffer);

        memset(sdp->mRawBuffer.get(), 0, sizeof(char)*(sdp->mOriginal.length()+1));
        memcpy(sdp->mRawBuffer.get(), blob, sizeof(char)*(sdp->mOriginal.length()));

        try {
          parseLines(*sdp);
          parseAttributes(*sdp);
          validateAttributeLevels(*sdp);
          parseLinesDetails(*sdp);
          processFlagAttributes(*sdp);
          processSessionLevelValues(*sdp);
          processMediaLevelValues(*sdp);
          processSourceLevelValues(*sdp);
        } catch (const SafeIntException &e) {
          ORTC_THROW_INVALID_PARAMETERS("value found out of legal value range" + string(e.m_code));
        }

        return sdp;
      }
开发者ID:openpeer,项目名称:ortc-lib,代码行数:29,代码来源:ortc_adapter_SDPParser_ParseSDP.cpp


示例5: tok

Lexer::Token Artlink::parse( Lexer* lexer )
{
    Lexer::Token tok( parseAttributes( lexer ) );
    while( tok != Lexer::END ) {
        if( tok == Lexer::TAG ) {
            if( lexer->tagId() == Lexer::LINK ) {
                Link* link( new Link( document, this, document->dataName(),
                            document->lexerLine(), document->lexerCol() ) );
                appendChild( link );
                link->setNoEndTag();
                link->setHypergraphic();
                tok = link->parse( lexer );
            }
            else if( lexer->tagId() == Lexer::EARTLINK || lexer->tagId() == Lexer::EUSERDOC )
                break;
            else
                parseCleanup( lexer, tok );
        }
        else {
            if( tok != Lexer::WHITESPACE )
                printError( ERR1_TAGCONTEXT );
            tok = document->getNextToken();
        }
    }
    return tok;
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:26,代码来源:artlink.cpp


示例6: uncompile

void VertexShader::compile()
{
    uncompile();

    compileToHLSL(mVertexCompiler);
    parseAttributes();
    parseVaryings();
}
开发者ID:langresser,项目名称:wp8external,代码行数:8,代码来源:Shader.cpp


示例7: parseAttributes

    int
Tag::parseFurther ()
{
    if (m_pTagAttrString)
    {
        parseAttributes (m_pTagAttrString);
    }
    return m_attrList.size ();
}
开发者ID:jaju,项目名称:hypar2,代码行数:9,代码来源:tag.cpp


示例8: tok

Lexer::Token P::parse( Lexer* lexer )
{
    Lexer::Token tok( parseAttributes( lexer ) );
    while( tok != Lexer::END && !( tok == Lexer::TAG && lexer->tagId() == Lexer::EUSERDOC ) ) {
        //may contain inline, not block
        if( parseInline( lexer, tok ) )
            break;
    }
    return tok;
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:10,代码来源:p.cpp


示例9: parseName

	void CModelReaderNode_Slices1507_Segment::parseXML(_In_ CXmlReader * pXMLReader) {
		// Parse name
		parseName(pXMLReader);

		// Parse attribute
		parseAttributes(pXMLReader);

		// Parse Content
		parseContent(pXMLReader);
	}
开发者ID:nTopology,项目名称:lib3mf,代码行数:10,代码来源:NMR_ModelReader_Slice1507_Segment.cpp


示例10: next

void AttributesParser::parse()
{
	const Token* pNext = next();
	if (!isEOF(pNext))
	{
		pNext = parseAttributes(pNext);
	}
	if (!isEOF(pNext))
		throw Poco::SyntaxException("extra tokens found in attribute declaration");
}
开发者ID:12307,项目名称:poco,代码行数:10,代码来源:AttributesParser.cpp


示例11: parseName

	void CModelReader_Slice1507_SliceRefModel::parseXML(_In_ CXmlReader * pXMLReader) {
		// Parse name
		parseName(pXMLReader);

		// Parse attribute
		parseAttributes(pXMLReader);

		// Parse Content
		parseContent(pXMLReader);
	}
开发者ID:3MFConsortium,项目名称:lib3mf,代码行数:10,代码来源:NMR_ModelReader_Slice1507_SliceRefModel.cpp


示例12: parseName

	void CModelReaderNode093_Components::parseXML(_In_ CXmlReader * pXMLReader)
	{
		// Parse name
		parseName(pXMLReader);

		// Parse attribute
		parseAttributes(pXMLReader);

		// Parse Content
		parseContent(pXMLReader);
	}
开发者ID:3MFConsortium,项目名称:lib3mf,代码行数:11,代码来源:NMR_ModelReaderNode093_Components.cpp


示例13: CNMRException

	void COpcPackageRelationshipReader::parseRootNode(_In_ CXmlReader * pXMLReader)
	{
		if (pXMLReader == nullptr)
			throw CNMRException(NMR_ERROR_INVALIDPARAM);

		parseAttributes(pXMLReader);

		while (!pXMLReader->IsEOF()) {
			LPCWSTR pwszLocalName = nullptr;
			LPCWSTR pwszNameSpaceURI = nullptr;
			UINT nCount = 0;
			UINT nNameSpaceCount = 0;

			eXmlReaderNodeType NodeType;
			pXMLReader->Read(NodeType);

			switch (NodeType) {
			case XMLREADERNODETYPE_STARTELEMENT:
				pXMLReader->GetLocalName(&pwszLocalName, &nCount);
				if (!pwszLocalName)
					throw CNMRException(NMR_ERROR_COULDNOTGETLOCALXMLNAME);

				pXMLReader->GetNamespaceURI(&pwszNameSpaceURI, &nNameSpaceCount);
				if (!pwszNameSpaceURI)
					throw CNMRException(NMR_ERROR_COULDNOTGETNAMESPACE);

				if (nCount > 0) {
					if (wcscmp(pwszNameSpaceURI, OPCPACKAGE_SCHEMA_RELATIONSHIPS) == 0) {
						if (wcscmp(pwszLocalName, OPC_RELS_RELATIONSHIP_NODE) == 0) {
							parseChildNode(pXMLReader);
						}
					}
				}
				break;

			case XMLREADERNODETYPE_ENDELEMENT:
				pXMLReader->GetLocalName(&pwszLocalName, &nCount);
				if (!pwszLocalName)
					throw CNMRException(NMR_ERROR_COULDNOTGETLOCALXMLNAME);

				if (wcscmp(pwszLocalName, OPC_RELS_RELATIONSHIP_CONTAINER) == 0) {
					return;
				}
				pXMLReader->CloseElement();
				break;

			case XMLREADERNODETYPE_UNKNOWN:
				break;

			case XMLREADERNODETYPE_TEXT:
				break;
			}
		}
	}
开发者ID:ChiefGyk,项目名称:lib3mf,代码行数:54,代码来源:NMR_OpcPackageRelationshipReader.cpp


示例14: parseName

	void CModelReaderNode100_Vertex::parseXML(_In_ CXmlReader * pXMLReader)
	{
		// Parse name
		parseName(pXMLReader);

		// Parse attribute
		parseAttributes(pXMLReader);

		// Parse Content
		parseContent(pXMLReader);
	}
开发者ID:Revware,项目名称:lib3mf,代码行数:11,代码来源:NMR_ModelReaderNode100_Vertex.cpp


示例15: parseName

	void CModelReaderNode_BeamLattice1702_BeamLattice::parseXML(_In_ CXmlReader * pXMLReader)
	{
		// Parse name
		parseName(pXMLReader);

		// Parse attribute
		parseAttributes(pXMLReader);

		// Parse Content
		parseContent(pXMLReader);

	}
开发者ID:3MFConsortium,项目名称:lib3mf,代码行数:12,代码来源:NMR_ModelReaderNode_BeamLattice1702_BeamLattice.cpp


示例16: parseName

	void CModelReaderNode_Slices1507_Vertex::parseXML(_In_ CXmlReader * pXMLReader) {
		// Parse name
		parseName(pXMLReader);

		// Parse attribute
		parseAttributes(pXMLReader);

		// Parse Content
		parseContent(pXMLReader);

		m_pSlice->addVertex(m_x, m_y);
	}
开发者ID:nTopology,项目名称:lib3mf,代码行数:12,代码来源:NMR_ModelReader_Slice1507_Vertex.cpp


示例17: parseDescriptionAttributes

// -------------------------------------------------------------------------------
void XMLPersister::parseNode( QDomNode& node,
                                     CTreeInformationElement& informationElement )
// -------------------------------------------------------------------------------
{
   if ( node.isElement() )
   {
      QDomElement elem = node.toElement();
      //cout<<"element; tagname= "<<elem.tagName()<<endl;

      if ( elem.tagName() == "Description" )
      {
         informationElement.setDescription( elem.text() );
         parseDescriptionAttributes( elem, informationElement );
      }
      else if ( elem.tagName() == "Information" )
      {
         // QDomText textNode=node.toText();
         //std::cout<<"==="<<elem.text()<<std::endl;

         // determine whether current elemenet contains encrypted data
         if ( false != bCurrentElementIsBase64Encrypted )
         {
            // do base64 decodeing
            //std::cout<<"decoding64"<<std::endl;
            CBase64Coder b64Coder = CBase64Coder::getInstance();
            QByteArray encryptedData;
            b64Coder.decode( encryptedData, elem.text() );

            informationElement.setEncryptedData( encryptedData );
         }
         else
         {
            informationElement.setInformation( elem.text() );
         }
      }
      else if ( elem.tagName() == "InformationElement" ) {
         CTreeInformationElement* e = new CTreeInformationElement( &informationElement );
         parseAttributes( elem, *e );
         informationElement.addChild( e );
         parseChildrenOf( node, *e );
      }

//    cout<<"!!! still guessing for richtext"<<endl;
//    if ( QStyleSheet::mightBeRichText(informationElement->getInformation()) )
//      informationElement->setInformationFormat(&InformationFormat::RTF);
//    else
//      informationElement->setInformationFormat(&InformationFormat::ASCII);

   }
}
开发者ID:Morius,项目名称:TuxCards,代码行数:51,代码来源:xmlpersister.cpp


示例18: FastXmlLine

	FastXmlLine(string str) {
		this->str = str;
		bool hasSlashAtBeginning = false;
		bool hasSlashAtEnd = false;
		bool hasOpen = false;
		bool hasClosed = false;
		for(int i = 0; i < str.size(); i++) {
			if(str[i]=='<') hasOpen = true;
			else if(str[i]=='>') hasClosed = true;
			else if(str[i]=='/') {
				if(i>0 && str[i-1]=='<') hasSlashAtBeginning = true;
				else hasSlashAtEnd = true;
			}
			
		}
		if(hasOpen && hasClosed) {
			if(hasSlashAtBeginning) {
				type = closeTag;
			} else if(hasSlashAtEnd) {
				type = emptyTag;
			} else {
				type = openTag;
			}
		} else {
			type = dataTag;
		}
		
		
		// find tag name
		if(type==openTag || type==emptyTag) {
			int start = str.find('<')+1;
			int spacePos = str.find(' ');
			int brackPos = str.find('>');
			int length = 0;
			if(spacePos!=-1) length = spacePos - start;
			else length = brackPos - start;
			name = str.substr(start, length);
		} else if(type==closeTag) {
			int start = str.find('/')+1;
			int brackPos = str.find('>');
			int length = brackPos - start;
			name = str.substr(start, length);
		}
		// find attributes
		
		if(type==openTag || type==emptyTag) {
			parseAttributes();
		}
	}
开发者ID:danielmorena,项目名称:ofxmarek,代码行数:49,代码来源:FastXml.cpp


示例19: Path

        SketchElement *PathParser::parse(SketchElement *parent,
                TiXmlElement *element)
        {
            Path *path = new Path(parent);
            parseAttributes(path, element);

            string data =
                    element->Attribute("d") ? element->Attribute("d") : "";

            PathDataParser *pathDataParser = new PathDataParser(path, data);
            pathDataParser->parse();
            delete pathDataParser;

            return path;
        }
开发者ID:ELMERzark,项目名称:JVGS,代码行数:15,代码来源:PathParser.cpp


示例20: return

 inline bool
 AsciiXmlParser::readNextElement()
 /* this reads in the entire next XML element. false is returned if the end
  * of the text was reached before a new XML element could be found (or if
  * no end for the next element could be found).
  */
 {
   return ( discardToNextTag()
            &&
            parseTagName( elementName )
            &&
            parseAttributes()
            &&
            recordToEndOfElement() );
 }
开发者ID:benoleary,项目名称:LesHouchesParserClasses_CPP,代码行数:15,代码来源:AsciiXmlParser.hpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ parseBlock函数代码示例发布时间:2022-05-30
下一篇:
C++ parseAttribute函数代码示例发布时间: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