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

xmli::timeBuilder Class Reference

Builder for a vector<time> from XML data. More...

#include <timeBuilder.h>

Inheritance diagram for xmli::timeBuilder:

xmli::Builder List of all members.

Public Member Functions

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

Detailed Description

Builder for a vector<time> from XML data.

Definition at line 13 of file timeBuilder.h.


Constructor & Destructor Documentation

xmli::timeBuilder::timeBuilder const char *  tag  ) 
 

Definition at line 22 of file timeBuilder.cxx.

00022                                             : xmli::Builder(tag) 
00023 { }


Member Function Documentation

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

Definition at line 27 of file timeBuilder.cxx.

References xmli::ChString::GetTime(), and xmli::ChString::Split().

00029 {
00030 //======================================================================
00031 // Build a vector<struct tm> and place it on the XMLIStack
00032 //   attr - list of attributes (none used...)
00033 //   buffer - space separated integers
00034 //======================================================================
00035   std::vector<std::string> vs;
00036   std::vector<time_t>      vi;
00037 
00038   // Split the string in to sub fields and extra the values from each
00039   // sub-field
00040   xmli::ChString::Split(buffer.c_str()," ,\n\t\r",vs);
00041   std::vector<std::string>::iterator itr(vs.begin());  
00042   std::vector<std::string>::iterator itrEnd(vs.end());
00043 
00044   for (; itr!=itrEnd; ++itr) {    
00045     time_t ttime = xmli::ChString::GetTime(*itr);
00046     vi.push_back(ttime);
00047   }
00048   
00049   // Add this vector of intean values into the "global" stack
00050   xmli::Stack<std::vector<time_t> >::Instance().push(vi);
00051 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 21 04:45:39 2009 for NOvA Offline by  doxygen 1.3.9.1