dtUtil::AttributeSearch Class Reference

Searches a Xerces XML Attribute list for names of interest. More...

#include <xercesutils.h>

List of all members.

Public Types

typedef std::map< std::string,
std::string > 
ResultMap

Public Member Functions

 AttributeSearch ()
 ~AttributeSearch ()
ResultMap operator() (const XERCES_CPP_NAMESPACE_QUALIFIER Attributes &attrs)
 Process the Attributes and make an easier structure to use.


Detailed Description

Searches a Xerces XML Attribute list for names of interest.

A helper used when searching with a known string. e.g. "mystring", "Type", "Name", or "Value". For example:

  void myHandler::startElement(... Attributes& attrs)
  {
    AttributeSearch attSearch;
    AttributeSearch::ResultMap results = attrSearch(attrs)
    AttributeSearch::ResultMap::iterator itr = results.find("Name");
    if (itr != results.end())
    {
       std::cout << "name is: " << itr->second << std::endl;
    }
  }

Member Typedef Documentation

typedef std::map<std::string,std::string> dtUtil::AttributeSearch::ResultMap


Constructor & Destructor Documentation

AttributeSearch::AttributeSearch (  ) 

AttributeSearch::~AttributeSearch (  ) 


Member Function Documentation

AttributeSearch::ResultMap AttributeSearch::operator() ( const XERCES_CPP_NAMESPACE_QUALIFIER Attributes &  attrs  ) 

Process the Attributes and make an easier structure to use.

Returns:
produces an associative container indexed on the attribute names.


http://www.delta3d.org
2.0.0 generated 14 Feb 2008