ofx_aggregate.hh
Go to the documentation of this file.
/***************************************************************************
ofx_aggregate.hh
-------------------
copyright : (C) 2005 by Ace Jones
email : acejones@users.sourceforge.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef OFX_AGGREGATE_H
#define OFX_AGGREGATE_H
#include <string>
class OfxAggregate
{
public:
OfxAggregate( const std::string& tag ): m_tag( tag )
{}
void Add( const std::string& tag, const std::string& data )
{
m_contents += std::string("<") + tag + std::string(">") + data + std::string("\r\n");
}
void AddXml( const std::string& tag, const std::string& data )
{
m_contents += std::string("<") + tag + std::string(">") + data + std::string("</") + tag + std::string(">") + std::string("\r\n");
}
void Add( const OfxAggregate& sub )
{
m_contents += sub.Output();
}
std::string Output( void ) const
{
return std::string("<") + m_tag + std::string(">\r\n") + m_contents + std::string("</") + m_tag + std::string(">\r\n");
}
private:
std::string m_tag;
std::string m_contents;
};
#endif // OFX_AGGREGATE_H
OfxAggregate::Add
void Add(const std::string &tag, const std::string &data)
Definition: ofx_aggregate.hh:64
OfxAggregate
A single aggregate as described in the OFX 1.02 specification.
Definition: ofx_aggregate.hh:40
OfxAggregate::AddXml
void AddXml(const std::string &tag, const std::string &data)
Definition: ofx_aggregate.hh:75
OfxAggregate::OfxAggregate
OfxAggregate(const std::string &tag)
Definition: ofx_aggregate.hh:55
OfxAggregate::Output
std::string Output(void) const
Definition: ofx_aggregate.hh:95