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

Public Member Functions | |
| intBuilder (const char *tag) | |
| void | Build (const AttributeList &attr, const std::string &buffer) |
Definition at line 13 of file intBuilder.h.
|
|
Definition at line 21 of file intBuilder.cxx. 00021 : xmli::Builder(tag) { }
|
|
||||||||||||
|
Definition at line 25 of file intBuilder.cxx. References xmli::ChString::Split(). 00027 {
00028 //======================================================================
00029 // Build a vector<int> and place it on the XMLIStack
00030 // attr - list of attributes (none used...)
00031 // buffer - space separated integers
00032 //======================================================================
00033 int i;
00034 std::vector<std::string> vs;
00035 std::vector<int> vi;
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 const char* c1 = itr->c_str();
00044 char* c2 = 0;
00045 i = strtol(c1,&c2,0);
00046 vi.push_back(i);
00047 }
00048
00049 // Add this vector of intean values into the "global" stack
00050 xmli::Stack<std::vector<int> >::Instance().push(vi);
00051 }
|
1.3.9.1