39 memset(&data, 0,
sizeof(data));
41 if (para_tag_identifier ==
"CCACCTFROM")
45 ASSIGN(data.account_type, data.OFX_CREDITCARD);
47 if (para_tag_identifier ==
"INVACCTFROM")
51 ASSIGN(data.account_type, data.OFX_INVESTMENT);
53 if (parentcontainer != NULL
54 && parentcontainer->type ==
"STATEMENT" 60 OfxAccountContainer::~OfxAccountContainer()
71 if ( identifier ==
"BANKID")
76 else if ( identifier ==
"BRANCHID")
81 else if ( identifier ==
"ACCTID")
86 else if ( identifier ==
"ACCTKEY")
90 else if ( identifier ==
"BROKERID")
95 else if ((identifier ==
"ACCTTYPE") || (identifier ==
"ACCTTYPE2"))
97 data.account_type_valid =
true;
98 if (value ==
"CHECKING")
100 data.account_type = data.OFX_CHECKING;
102 else if (value ==
"SAVINGS")
104 data.account_type = data.OFX_SAVINGS;
106 else if (value ==
"MONEYMRKT")
108 data.account_type = data.OFX_MONEYMRKT;
110 else if (value ==
"CREDITLINE")
112 data.account_type = data.OFX_CREDITLINE;
114 else if (value ==
"CMA")
116 data.account_type = data.OFX_CMA;
121 data.account_type_valid =
false;
133 libofx_context->accountCallback(data);
141 if (MainContainer != NULL)
143 return MainContainer->add_container(
this);
151 void OfxAccountContainer::gen_account_id(
void)
153 if (data.account_type == OfxAccountData::OFX_CREDITCARD)
155 STRNCPY(data.account_id, std::string(data.account_id) + m_acctid +
" " + m_acctkey);
156 STRNCPY(data.account_name, std::string(data.account_name) +
"Credit card " + m_acctid);
158 else if (data.account_type == OfxAccountData::OFX_INVESTMENT)
160 STRNCPY(data.account_id, std::string(data.account_id) + m_brokerid +
" " + m_acctid);
161 STRNCPY(data.account_name, std::string(data.account_name) +
"Investment account " +
162 m_acctid +
" at broker " + m_brokerid);
166 STRNCPY(data.account_id, std::string(data.account_id) + m_bankid +
" " + m_branchid +
" " + m_acctid);
167 STRNCPY(data.account_name, std::string(data.account_name) +
"Bank account " + m_acctid);
169 data.account_id_valid =
true;
A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer.
virtual void add_attribute(const std::string identifier, const std::string value)
Add data to a container object.
virtual int gen_event()
Generate libofx.h events.
Various simple functions for type conversion & al.
int add_to_main_tree()
Add this container to the main tree.
Represents a statement for either a bank account or a credit card account.
void STRNCPY(T &dest, const std::string &src)
#define ASSIGN_STRNCPY(DEST, VALUE)
LibOFX internal object code.
void add_attribute(const std::string identifier, const std::string value)
Add data to a container object.
Message IO functionality.
The root container. Created by the <OFX> OFX element or by the export functions.
#define ASSIGN(DEST, VALUE)