Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

xmli::xmlfileBuilder Class Reference

Handle the xmlfile tag which defines a list of XML files to parse. More...

#include <xmlfileBuilder.h>

Inheritance diagram for xmli::xmlfileBuilder:

xmli::Builder List of all members.

Public Member Functions

 xmlfileBuilder (const char *tag)
void Build (const AttributeList &attr, const std::string &buffer)

Detailed Description

Handle the xmlfile tag which defines a list of XML files to parse.

Definition at line 14 of file xmlfileBuilder.h.


Constructor & Destructor Documentation

xmli::xmlfileBuilder::xmlfileBuilder const char *  tag  ) 
 

Definition at line 23 of file xmlfileBuilder.cxx.

00023 : xmli::Builder(tag) { }


Member Function Documentation

void xmli::xmlfileBuilder::Build const AttributeList attr,
const std::string &  buffer
 

Definition at line 27 of file xmlfileBuilder.cxx.

References xmli::AttributeList, xmli::ReadFile(), and xmli::ChString::Split().

00029 {
00030 //======================================================================
00031 // Handle the xmlfile tag.
00032 //
00033 // At the end of the tag, parse each of the files listed in "buffer"
00034 //======================================================================
00035   
00036   // Split the string in to sub fields and extra the values from each
00037   // sub-field
00038   std::vector<std::string> files;
00039   xmli::ChString::Split(buffer.c_str()," ,\n\t\r",files);
00040 
00041   // Parse each file
00042   std::vector<std::string>::iterator itr(files.begin());  
00043   std::vector<std::string>::iterator itrEnd(files.end());
00044   for (; itr!=itrEnd; ++itr) { 
00045     int nread = xmli::ReadFile(itr->c_str()); 
00046     if (nread<1) {
00047       std::cerr << 
00048         "xmli::xmlfileBuilder: File '" << itr->c_str() << 
00049         "' does not exist." << std::endl;
00050       exit(1);
00051     }
00052   }
00053 }


The documentation for this class was generated from the following files:
Generated on Thu Jul 24 12:01:21 2008 for NOvA Offline by doxygen 1.3.5