LibOFX
lib/ofx_aggregate.hh
Go to the documentation of this file.
1 /***************************************************************************
2  ofx_aggregate.hh
3  -------------------
4  copyright : (C) 2005 by Ace Jones
5  email : acejones@users.sourceforge.net
6 ***************************************************************************/
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  ***************************************************************************/
19 
20 #ifndef OFX_AGGREGATE_H
21 #define OFX_AGGREGATE_H
22 
23 #include <string>
24 
25 using namespace std;
26 
42 class OfxAggregate
43 {
44 public:
50  OfxAggregate( const string& tag ): m_tag( tag )
51  {}
52 
59  void Add( const string& tag, const string& data )
60  {
61  m_contents += string("<") + tag + string(">") + data + string("\r\n");
62  }
63 
70  void AddXml( const string& tag, const string& data )
71  {
72  m_contents += string("<") + tag + string(">") + data + string("</") + tag + string(">") + string("\r\n");
73  }
74 
80  void Add( const OfxAggregate& sub )
81  {
82  m_contents += sub.Output();
83  }
84 
90  string Output( void ) const
91  {
92  return string("<") + m_tag + string(">\r\n") + m_contents + string("</") + m_tag + string(">\r\n");
93  }
94 
95 private:
96  string m_tag;
97  string m_contents;
98 };
99 
100 #endif // OFX_AGGREGATE_H
A single aggregate as described in the OFX 1.02 specification.
void Add(const string &tag, const string &data)
void Add(const OfxAggregate &sub)
void AddXml(const string &tag, const string &data)
OfxAggregate(const string &tag)