LibOFX

fx-0.9.14/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
69 void Add( const OfxAggregate& sub )
70 {
71 m_contents += sub.Output();
72 }
73
79 string Output( void ) const
80 {
81 return string("<") + m_tag + string(">\r\n") + m_contents + string("</") + m_tag + string(">\r\n");
82 }
83
84 private:
85 string m_tag;
86 string m_contents;
87 };
88
89 #endif // OFX_AGGREGATE_H
std
OfxAggregate
A single aggregate as described in the OFX 1.02 specification.
Definition: ofx_aggregate.hh:42
OfxAggregate::Add
void Add(const string &tag, const string &data)
Definition: fx-0.9.14/lib/ofx_aggregate.hh:59
OfxAggregate::Output
string Output(void) const
Definition: ofx_aggregate.hh:79
OfxAggregate::Add
void Add(const OfxAggregate &sub)
Definition: fx-0.9.14/lib/ofx_aggregate.hh:69
OfxAggregate::OfxAggregate
OfxAggregate(const string &tag)
Definition: fx-0.9.14/lib/ofx_aggregate.hh:50