#include <doubleBuilder.h>
Inheritance diagram for xmli::doubleBuilder:

Public Member Functions | |
| doubleBuilder (const char *tag) | |
| void | Build (const AttributeList &attr, const std::string &buffer) |
Definition at line 14 of file doubleBuilder.h.
|
|
Definition at line 20 of file doubleBuilder.cxx. 00020 : xmli::Builder(tag) { }
|
|
||||||||||||
|
Definition at line 24 of file doubleBuilder.cxx. References xmli::ChString::Split(). 00026 {
00027 //======================================================================
00028 // Build vector<double> from XML data and place it on the XMLIStack
00029 //
00030 // attr - unused
00031 // buffer - list of space-separted floating point numbers
00032 //======================================================================
00033 double d;
00034 std::vector<std::string> vs;
00035 std::vector<double> vd;
00036
00037 // Split the string in to sub fields and extra the values from each
00038 // sub-field
00039 xmli::ChString::Split(buffer.c_str()," ,\n\t\r",vs);
00040 std::vector<std::string>::iterator itr(vs.begin());
00041 std::vector<std::string>::iterator itrEnd(vs.end());
00042 for (; itr!=itrEnd; ++itr) {
00043 d = atof(itr->c_str());
00044 vd.push_back(d);
00045 }
00046
00047 // Add this vector of doubleean values into the "global" stack
00048 xmli::Stack<std::vector<double> >::Instance().push(vd);
00049 }
|
1.3.9.1