Source
vector< vector< vector< vector<ArrayTimeInterval> > > >Parser::get4DArrayTimeInterval(const string &name, const string &tableName, const string &xmlDoc)
/*
* ALMA - Atacama Large Millimeter Array
* (c) European Southern Observatory, 2002
* (c) Associated Universities Inc., 2002
* Copyright by ESO (in the framework of the ALMA collaboration),
* Copyright by AUI (in the framework of the ALMA collaboration),
* All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY, without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Warning!
* --------------------------------------------------------------------
* | This is generated code! Do not modify this file. |
* | If you do, all changes will be lost when the file is re-generated. |
* --------------------------------------------------------------------
*
* File Parser.cpp
*/
using asdm::OutOfBoundsException;
using asdm::NumberFormatException;
using asdm::Boolean;
using asdm::Byte;
using asdm::Character;
using asdm::Double;
using asdm::Float;
using asdm::Integer;
using asdm::Long;
using asdm::Short;
using namespace std;
namespace asdm {
string Parser::substring(const string &s, int a, int b) {
return s.substr(a,(b - a));
}
string Parser::trim(const string &s) {
unsigned int i = 0;
//while (s.at(i) == ' ' && i < s.length())
while (i < s.length() && s.at(i) == ' ')
++i;
if (i == s.length())
return "";
unsigned int j = s.length() - 1;
//while (s.at(j) == ' ' && j > i)
while (j > i && s.at(j) == ' ')
--j;
return substring(s,i,j + 1);
}
string Parser::encode(const string &s) {
return boost::property_tree::xml_parser::encode_char_entities(s);
string result;
for (string::const_iterator it=s.begin(); it!=s.end();++it) {
switch(*it) {
case '&': result += "&"; break;