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


C++ parseAttributes函数代码示例

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


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


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