1 #ifndef SDMDataObjectParser_CLASS
2 #define SDMDataObjectParser_CLASS
7 #include <libxml/parser.h>
8 #include <libxml/tree.h>
45 #include <boost/regex.hpp>
54 #include "almaEnumerations_IFC.h"
62 namespace asdmbinaries {
102 return "SDMDataObjectParserException : " +
message;
154 #ifndef WITHOUT_BOOST
182 const static std::string
APC;
183 const static std::string
REF;
189 const static std::string
SW;
227 #ifndef WITHOUT_BOOST
250 const static std::string
REF;
278 #ifndef WITHOUT_BOOST
300 const static std::string
REF;
329 static void inElements(
xmlNode* a_node,
const std::vector<std::string>& elementNames);
331 static xmlAttr*
hasAttr(
xmlNode* a_node,
const std::string& attrName);
333 static void tokenize(
const std::string& str,
334 std::vector<std::string>& tokens,
335 const std::string& delimiters =
" ");
337 static void tokenize(
const std::string& str,
338 std::set<std::string>& tokens,
339 const std::string& delimiters =
" ");
340 static std::string
substring(
const std::string &s,
int a,
int b);
341 static std::string
trim(
const std::string &s);
357 if ((attr =
hasAttr(a_node, attrName))) {
358 std::string s = std::string((
const char*)attr->children->content);
363 catch(std::string m) {
372 if ((a_node != NULL) && (a_node->next == NULL)) {
377 catch (std::string m) {
389 template<
class Enum,
class EnumHelper>
static std::vector<Enum>
parseStringsAttr(
xmlNode* a_node,
const std::string& attrName) {
392 if ((attr =
hasAttr(a_node, attrName))) {
393 std::vector<std::string> v_s;
394 tokenize((
const char*)attr->children->content, v_s);
396 std::vector<Enum> result;
399 for (i = 0; i < v_s.size(); i++)
400 result.push_back(EnumHelper::literal(v_s.at(i)));
403 catch (std::string m) {
417 #ifndef WITHOUT_BOOST
437 #endif // HeaderParser_CLASS
static std::string trim(const std::string &s)
SDMDataObject:: declarations.
static std::vector< std::string > parseStringsAttr(xmlNode *a_node, const std::string &attrName)
void parseMemoryHeader(const std::string &buffer, SDMDataObject &sdmDataObject)
static Enum parseStringAttr(xmlNode *a_node, const std::string &attrName)
static std::string parseString(xmlNode *a_node)
SDMDataObject::Baseband:: declarations.
static bool parseBoolAttr(xmlNode *a_node, const std::string &attrName)
static std::string substring(const std::string &s, int a, int b)
static const boost::regex PROJECTPATH4OR5
static long long parseLongLong(xmlNode *a_node)
static std::vector< unsigned int > parseProjectPath(xmlNode *a_node, unsigned int len)
static const boost::regex PROJECTPATH5
static void isElement(xmlNode *a_node, const std::string &elementName)
A subclass of binaryPart to describe the autodata.
void parseMemoryCorrSubsetHeader(const std::string &buffer, SDMDataSubset &sdmCorrSubset)
A subclass of binaryPart to describe the zeroLags.
static const ByteOrder * parseByteOrderAttr(xmlNode *a_node, const std::string &attrName)
static bool parseBool(xmlNode *a_node)
void parseFileTPSubsetHeader(const std::string &filename, SDMDataSubset &sdmCorrDataSubset)
static std::string parseStringAttr(xmlNode *a_node, const std::string &attrName)
static int parseIntAttr(xmlNode *a_node, const std::string &attrName)
static const boost::regex PROJECTPATH3
static bool testElement(xmlNode *a_node, const std::string &elementName)
virtual ~SDMDataObjectParser()
std::string getMessage() const
Returns the message associated to this exception.
SDMDataObjectParserException()
An empty contructor.
static const boost::regex PROJECTPATH4
void parseFileCorrSubsetHeader(const std::string &filename, SDMDataSubset &sdmCorrSubset)
static Enum parseLiteral(xmlNode *a_node)
static int parseInt(xmlNode *a_node)
void parseFileHeader(const std::string &filename, SDMDataObject &sdmDataObject)
CorrSubsetHeaderParser corrSubsetHeaderParser
HeaderParser headerParser
virtual ~SDMDataObjectParserException()
The destructor.
A class to represent byte order information.
void parseMemoryTPSubsetHeader(const std::string &filename, SDMDataSubset &sdmCorrDataSubset)
static void inElements(xmlNode *a_node, const std::vector< std::string > &elementNames)
static xmlAttr * hasAttr(xmlNode *a_node, const std::string &attrName)
TableExprNode regex(const TableExprNode &node)
Functions for regular expression matching and pattern matching.
static std::vector< Enum > parseStringsAttr(xmlNode *a_node, const std::string &attrName)
TPSubsetHeaderParser tpSubsetHeaderParser
static std::set< std::string > parseStringSetAttr(xmlNode *a_node, const std::string &attrName)
static float parseFloatAttr(xmlNode *a_node, const std::string &attrName)
SDMDataObject::BinaryPart:: declarations.
A class to represent an exception thrown during the parsing of an XML header in a MIME message contai...
static void tokenize(const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" ")
static float parseFloat(xmlNode *a_node)