39 memset(&data, 0,
sizeof(data));
42 OfxStatementContainer::~OfxStatementContainer()
52 if (identifier ==
"CURDEF")
54 strncpy(data.
currency, value.c_str(), OFX_CURRENCY_LENGTH);
55 data.currency_valid = !value.empty();
57 else if (identifier ==
"MKTGINFO")
59 strncpy(data.
marketing_info, value.c_str(), OFX_MARKETING_INFO_LENGTH);
60 data.marketing_info_valid =
true;
62 else if (identifier ==
"DTASOF")
65 data.date_asof_valid =
true;
67 else if (identifier ==
"DTSTART")
70 data.date_start_valid =
true;
72 else if (identifier ==
"DTEND")
75 data.date_end_valid =
true;
88 data.ledger_balance_valid = ptr_balance_container->amount_valid;
90 data.ledger_balance_date_valid = ptr_balance_container->
date_valid;
96 data.available_balance_valid = ptr_balance_container->amount_valid;
98 data.available_balance_date_valid = ptr_balance_container->
date_valid;
103 data.available_balance_valid = ptr_balance_container->amount_valid;
105 data.available_balance_date_valid = ptr_balance_container->
date_valid;
110 data.
buying_power = ptr_balance_container->buying_power;
111 data.buying_power_valid = ptr_balance_container->buying_power_valid;
122 if (MainContainer != NULL)
124 return MainContainer->add_container(
this);
134 libofx_context->statementCallback(data);
139 void OfxStatementContainer::add_account(
OfxAccountData * account_data)
141 if (account_data->account_id_valid ==
true)
145 data.account_id_valid =
true;
time_t ledger_balance_date
virtual int gen_event()
Generate libofx.h events.
An abstraction of an account.
A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer.
char account_id[OFX_ACCOUNT_ID_LENGTH]
Various simple functions for type conversion & al.
virtual void add_attribute(const string identifier, const string value)
Add data to a container object.
char marketing_info[OFX_MARKETING_INFO_LENGTH]
time_t ofxdate_to_time_t(const string ofxdate)
Convert a C++ string containing a time in OFX format to a C time_t.
char account_id[OFX_ACCOUNT_ID_LENGTH]
int message_out(OfxMsgType error_type, const string message)
Message output function.
time_t available_balance_date
LibOFX internal object code.
struct OfxAccountData * account_ptr
Message IO functionality.
void add_attribute(const string identifier, const string value)
Add data to a container object.
char currency[OFX_CURRENCY_LENGTH]
The root container. Created by the <OFX> OFX element or by the export functions.
Represents the <BALANCE>, <INVBAL> or <INV401KBAL> OFX SGML entity.
bool margin_balance_valid
virtual int add_to_main_tree()
Add this container to the main tree.