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


C++ AttributeList::getLength方法代码示例

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


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

示例1: startElement

void BulletMLParserXercesSAXHandler::startElement(const XMLCh* const name,
												  AttributeList& attributes)
{
	BulletMLNode* node = parser_->addContent(parser_->uc2string(name));

	if (node->getName() == BulletMLNode::bulletml) {
		for (unsigned int i = 0; i < attributes.getLength(); i++) {
			if (parser_->uc2string(attributes.getName(i)) == "type" &&
				parser_->uc2string(attributes.getValue(i)) == "horizontal")
			{
				parser_->setHorizontal();
			}
		}
	}
	else {
		BulletMLParserXerces::MyAttributes mattr;
		for (unsigned int i = 0; i < attributes.getLength(); i++) {
			mattr.push_back(parser_->uc2string(attributes.getName(i)));
			mattr.push_back(parser_->uc2string(attributes.getValue(i)));
		}
		parser_->addAttribute(mattr, node);
	}

	if (curNode_ != 0) curNode_->addChild(node);
	curNode_ = node;
}
开发者ID:Bracket-,项目名称:psp-ports,代码行数:26,代码来源:bulletmlparser-xerces.cpp

示例2: StoreNameValueAttributes

/*
 * Stores the attributes from a name value type element.
 * Parse out the probe array type into its own member.
 */
void SAXArrayHandlers::StoreNameValueAttributes(AttributeList&  attributes)
{
	unsigned int len = attributes.getLength();
	AttributeNameValueType param;
	for (unsigned int index = 0; index < len; index++)
	{
		if (attributes.getName(index) == NAME_ATTRIBUTE)
		{
			param.name = XMLChToString(attributes.getValue(index));
		}
		else if (attributes.getName(index) == VALUE_ATTRIBUTE)
		{
			param.value = XMLChToString(attributes.getValue(index));
		}
		else if (attributes.getName(index) == TYPE_ATTRIBUTE)
		{
			param.type = XMLChToString(attributes.getValue(index));
			if (param.name == PROBE_ARRAY_TYPE_PARAMETER_NAME)
			{
				arrayData->SetArrayType(param.value);
			}
			else
			{
				arrayData->Attributes().push_back(param);
			}
		}
	}
}
开发者ID:HenrikBengtsson,项目名称:affxparser,代码行数:32,代码来源:SAXDttArrayHandlers.cpp

示例3:

void SAX_TransAGHandler::structuredMetaStart
(const XMLCh* const name, AttributeList& attr)
{
  string s;
  // if start-of-element is reported,
  // store structured element as XML string in feature value
  // and push structuredMetaEnd handler
  //  storeMetaValueStart(name, attr);
  if ( ! prevValue.empty() ) prevValue += " ";
  prevValue += "<";
  prevValue += set_string(s, name);
  for ( int i = 0; i < attr.getLength(); ++i ) {
    prevValue += " ";
    prevValue += set_string(s, attr.getName(i));
    prevValue += "=\"";
    prevValue += set_string(s, attr.getValue(i));
    prevValue += "\"";
  }

  prevValue += ">";
  prevPos = prevValue.length();

  StartStack.push(&SAX_TransAGHandler::structuredMetaStart);
  EndStack.push(&SAX_TransAGHandler::structuredMetaEnd);
}
开发者ID:eroux,项目名称:transcriber-ag,代码行数:25,代码来源:SAX_TransAGHandler.cpp

示例4: startElement

void SAXPrintHandlers::startElement(const   XMLCh* const    name
                                    ,       AttributeList&  attributes)
{
    // The name has to be representable without any escapes
    fFormatter  << XMLFormatter::NoEscapes
                << chOpenAngle << name;

    unsigned int len = attributes.getLength();
    for (unsigned int index = 0; index < len; index++)
    {
        //
        //  Again the name has to be completely representable. But the
        //  attribute can have refs and requires the attribute style
        //  escaping.
        //
        fFormatter  << XMLFormatter::NoEscapes
                    << chSpace << attributes.getName(index)
                    << chEqual << chDoubleQuote
                    << XMLFormatter::AttrEscapes
		            << attributes.getValue(index)
                    << XMLFormatter::NoEscapes
                    << chDoubleQuote;
    }
    fFormatter << chCloseAngle;
}
开发者ID:xin3liang,项目名称:platform_external_xerces-cpp,代码行数:25,代码来源:SAXPrintHandlers.cpp

示例5:

void
StdInParseHandlers::startElement(   const   XMLCh* const    /* name */
                                    ,       AttributeList&  attributes)
{
    fElementCount++;
    fAttrCount += attributes.getLength();
}
开发者ID:xin3liang,项目名称:platform_external_xerces-cpp,代码行数:7,代码来源:StdInParseHandlers.cpp

示例6: startElement

 void startElement(const XMLCh* const name, AttributeList& attrList)
 {
   string label=XMLString::transcode(name);
   map<string,string> attrs;
   for (unsigned int i=0;i<attrList.getLength();i++)
     attrs[XMLString::transcode(attrList.getName(i))] = XMLString::transcode(attrList.getValue(i));
   myStream.onElement(label, attrs);
 }
开发者ID:arjunroy,项目名称:modelnet-core,代码行数:8,代码来源:xml.cpp

示例7: if

void 
SBlogErrorMapper::MySAXHandler::startElement(const XMLCh* const name,
					     AttributeList& attributes)
{
  // 1. parse module name from the root
  XMLCh2VXIchar(name, tempString, 4096); 
  if(wcscmp(tempString, L"ErrorMessages") == 0)
  {
    for(unsigned int i = 0; i < attributes.getLength(); i++)
    {
      XMLCh2VXIchar(attributes.getName(i), tempString, 4096); 
      if(wcscmp(tempString, L"moduleName") == 0)
      {
        XMLCh2VXIchar(attributes.getValue(i), tempString, 4096);
        moduleName = tempString;
      }
    }
  }
  // 2. only care about <error> elements
  else if(wcscmp(tempString, L"error") == 0) {
    isProcessing = 1;
    errorMessage = L"";

    // Find the error number and severity (tag attributes)
    for (unsigned int i = 0; i < attributes.getLength(); i++) {
      XMLCh2VXIchar(attributes.getName(i), tempString, 4096); 
      if(wcscmp(tempString, L"num") == 0) {
        XMLCh2VXIchar(attributes.getValue(i), tempString, 4096); 
        errorNumber = wtoint(tempString);
      }
      else if(wcscmp(tempString, L"severity") == 0) {
        XMLCh2VXIchar(attributes.getValue(i), tempString, 4096); 
        errorSeverity = wtoint(tempString);
      }
    }
  }
  else if(wcscmp(tempString, L"advice") == 0) {
    // ignore the advice tag, just concate the advice's message    
  }
  else if(isProcessing)
    errorMessage += L"???"; // Runtime-determined value, unknown
}
开发者ID:ausmarton,项目名称:voiceglue-centos-6,代码行数:42,代码来源:SBlogMapper.cpp

示例8: StoreExperimentNameAttribute

/*
 * Stores the experiment name attribute from the experiment element.
 */
void SAXArrayHandlers::StoreExperimentNameAttribute(AttributeList&  attributes)
{
	unsigned int len = attributes.getLength();
	for (unsigned int index = 0; index < len; index++)
	{
		if (attributes.getName(index) == NAME_ATTRIBUTE)
		{
			arrayData->SetExperimentName(XMLChToString(attributes.getValue(index)));
			break;
		}
	}
}
开发者ID:HenrikBengtsson,项目名称:affxparser,代码行数:15,代码来源:SAXDttArrayHandlers.cpp

示例9:

//
// startElement - our SAX handler callback function for startElement.
//                Update the document checksum with the element name
//                and any attribute names and values.
//
 void ThreadParser::SAXHandler::startElement(const XMLCh *const name, AttributeList &attributes)
{
    SAXInstance->addToCheckSum(name);
    XMLSize_t n = attributes.getLength();
    XMLSize_t i;
    for (i=0; i<n; i++)
    {
        const XMLCh *attNam = attributes.getName(i);
        SAXInstance->addToCheckSum(attNam);
        const XMLCh *attVal = attributes.getValue(i);
        SAXInstance->addToCheckSum(attVal);
    }
}
开发者ID:ideasiii,项目名称:ControllerPlatform,代码行数:18,代码来源:ThreadTest.cpp

示例10: startElement

void OptionsLoader::startElement(const XMLCh* const name,
                                 AttributeList& attributes) {
    myItem = TplConvert<XMLCh>::_2str(name);
    for (int i = 0; i < (int) attributes.getLength(); i++) {
        std::string key = TplConvert<XMLCh>::_2str(attributes.getName(i));
        std::string value = TplConvert<XMLCh>::_2str(attributes.getValue(i));
        if (key == "value" || key == "v") {
            key = myItem;
        }
        setValue(key, value);
    }
    myValue = "";
}
开发者ID:NeziheSozen,项目名称:sumo,代码行数:13,代码来源:OptionsLoader.cpp

示例11: StoreSampleProjectAttribute

/*
 * Stores the sample project attribute from the biosource/characteristics element.
 */
void SAXArrayHandlers::StoreSampleProjectAttribute(AttributeList&  attributes)
{
	unsigned int len = attributes.getLength();
	for (unsigned int index = 0; index < len; index++)
	{
		if (attributes.getName(index) == ONTOLOGY_VALUE_ATTRIBUTE)
		{
			AttributeNameValueType param;
			param.name = GCOS_SAMPLE_PROJECT_PARAMETER_NAME;
			param.value = XMLChToString(attributes.getValue(index));
			param.type = STRING_TYPE;
			arrayData->Attributes().push_back(param);
			break;
		}
	}
}
开发者ID:HenrikBengtsson,项目名称:affxparser,代码行数:19,代码来源:SAXDttArrayHandlers.cpp

示例12: jsonize

    const std::string jsonize(AttributeList &attrs) {
        StringBuffer s;
        Writer<StringBuffer> w(s);

        w.StartObject();
        for (int i = 0; i < attrs.getLength(); ++i) {
            const XMLCh* name = attrs.getName(i);
            char *tmpName = XMLString::transcode(name),
                 *tmpValue = XMLString::transcode(attrs.getValue(name));
            w.String(tmpName);
            w.String(tmpValue);
            XMLString::release(&tmpName);
            XMLString::release(&tmpValue);
        }
        w.EndObject();

        return s.GetString();
    }
开发者ID:jkozera,项目名称:zest-travis-testing,代码行数:18,代码来源:main.cpp

示例13: findName

string DictionaryHandler::findName( AttributeList& attributes )
{
	string str;
	XMLSize_t i = 0;
	XMLSize_t numAttributes = attributes.getLength();

	for ( i = 0; i < numAttributes; i++ ) {
		const XMLCh *xmlName = attributes.getName( i );
		char *name = XMLString::transcode( xmlName );
		if ( strncmp( name, "name", 5 ) == 0 ) {
			const XMLCh *xmlValue = attributes.getValue( i );
			char *value = XMLString::transcode( xmlValue );
			str = string( static_cast<const char *>( value ) );
			XMLString::release( &value );
		}
		XMLString::release( &name );
	}

	return str;
}
开发者ID:robinjohnhopkins,项目名称:xercesc,代码行数:20,代码来源:handler.cpp

示例14: startElement

void TestCasesHandler::startElement(const XMLCh* const name, AttributeList& attributes)
{
	Transcode attributeName;
	Transcode attributeType;
	Transcode attributeValue;
	Transcode message;

	try 
	{
		message.translate(name);		
		cout << "<" << message.getString() << ">" << endl;
		const string messageString(message.getChar());

		m_currentStartElement = createTagClass(messageString);
		m_tagStack.push(m_currentStartElement);
	}
	catch(nullString &)
	{

		//Do nothing	
		cout << "caught nullString on message.getChar()" << endl;
	}

	for(unsigned int i = 0; i < attributes.getLength(); i++)
	{
		try
		{
			attributeName.translate(attributes.getName(static_cast<unsigned int>(i)));
			cout << "Attribute name:" << attributeName.getString() << endl;

			attributeValue.translate(attributes.getValue(static_cast<unsigned int>(i)));
			cout << "Attribute Value:" + attributeValue.getString() << endl;
			m_currentStartElement->setAttribute(attributeName.getStringPimpl(), attributeValue.getStringPimpl());
		}
		catch(nullString &)
		{
			//Do nothing	
			cout << "caught nullString on attributeValue.getChar()" << endl;
		}
	}
}
开发者ID:Tiger66639,项目名称:librebecca,代码行数:41,代码来源:TestCasesHandler.cpp

示例15: startElement

    void FeatureDocumentHandler::startElement(const XMLCh* const name, AttributeList& attrs)
    {
        char elementName[1024];

        XMLString::transcode(name, elementName, 1024 - 1);
        std::string elemName(elementName);
        std::map<std::string, std::string> attributes;
        
        for (unsigned int c = 0; c < attrs.getLength() ; c++) 
        {
            char attributeName[1024];
            char attributeValue [1024];
            XMLString::transcode(attrs.getName(c), attributeName, 1024 - 1);
            XMLString::transcode(attrs.getValue(c), attributeValue, 1024 - 1);
            std::string attribName(attributeName);
            std::string attribVal(attributeValue);

            attributes.insert(Pair_Attrib(attribName, attribVal));
        }
        m_pFeatureMat->StartElement(elemName, attributes);
    }
开发者ID:awaytools,项目名称:AwayExtensions-FlashPro,代码行数:21,代码来源:MyXmlParser.cpp


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