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;
87 data.ledger_balance = ptr_balance_container->
amount;
88 data.ledger_balance_valid = ptr_balance_container->amount_valid;
89 data.ledger_balance_date = ptr_balance_container->
date;
90 data.ledger_balance_date_valid = ptr_balance_container->
date_valid;
95 data.available_balance = ptr_balance_container->
amount;
96 data.available_balance_valid = ptr_balance_container->amount_valid;
97 data.available_balance_date = ptr_balance_container->
date;
98 data.available_balance_date_valid = ptr_balance_container->
date_valid;
102 data.available_balance = ptr_balance_container->
amount;
103 data.available_balance_valid = ptr_balance_container->amount_valid;
104 data.available_balance_date = ptr_balance_container->
date;
105 data.available_balance_date_valid = ptr_balance_container->
date_valid;
106 data.margin_balance = ptr_balance_container->margin_balance;
108 data.short_balance = ptr_balance_container->short_balance;
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)
143 data.account_ptr = account_data;
144 strncpy(data.account_id, account_data->
account_id, OFX_ACCOUNT_ID_LENGTH);
145 data.account_id_valid =
true;
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.
LibOFX internal object code.
virtual void add_attribute(const string identifier, const string value)
Add data to a container object.
char currency[OFX_CURRENCY_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.
int message_out(OfxMsgType error_type, const string message)
Message output function.
Message IO functionality.
void add_attribute(const string identifier, const string value)
Add data to a container object.
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.