本文整理汇总了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);
}
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例6: uncompile
void VertexShader::compile()
{
uncompile();
compileToHLSL(mVertexCompiler);
parseAttributes();
parseVaryings();
}
示例7: parseAttributes
int
Tag::parseFurther ()
{
if (m_pTagAttrString)
{
parseAttributes (m_pTagAttrString);
}
return m_attrList.size ();
}
示例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;
}
示例9: parseName
void CModelReaderNode_Slices1507_Segment::parseXML(_In_ CXmlReader * pXMLReader) {
// Parse name
parseName(pXMLReader);
// Parse attribute
parseAttributes(pXMLReader);
// Parse Content
parseContent(pXMLReader);
}
示例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");
}
示例11: parseName
void CModelReader_Slice1507_SliceRefModel::parseXML(_In_ CXmlReader * pXMLReader) {
// Parse name
parseName(pXMLReader);
// Parse attribute
parseAttributes(pXMLReader);
// Parse Content
parseContent(pXMLReader);
}
示例12: parseName
void CModelReaderNode093_Components::parseXML(_In_ CXmlReader * pXMLReader)
{
// Parse name
parseName(pXMLReader);
// Parse attribute
parseAttributes(pXMLReader);
// Parse Content
parseContent(pXMLReader);
}
示例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;
}
}
}
示例14: parseName
void CModelReaderNode100_Vertex::parseXML(_In_ CXmlReader * pXMLReader)
{
// Parse name
parseName(pXMLReader);
// Parse attribute
parseAttributes(pXMLReader);
// Parse Content
parseContent(pXMLReader);
}
示例15: parseName
void CModelReaderNode_BeamLattice1702_BeamLattice::parseXML(_In_ CXmlReader * pXMLReader)
{
// Parse name
parseName(pXMLReader);
// Parse attribute
parseAttributes(pXMLReader);
// Parse Content
parseContent(pXMLReader);
}