42   memset(&data, 0, 
sizeof(data));
 
   45   while (tmp_parentcontainer != NULL && tmp_parentcontainer->
type != 
"STATEMENT")
 
   47     tmp_parentcontainer = tmp_parentcontainer->parentcontainer;
 
   49   if (tmp_parentcontainer != NULL)
 
   55     parent_statement = NULL;
 
   56     message_out(
ERROR, 
"Unable to find the enclosing statement container this transaction");
 
   58   if (parent_statement != NULL && parent_statement->data.account_id_valid == 
true)
 
   60     strncpy(data.
account_id, parent_statement->data.account_id, OFX_ACCOUNT_ID_LENGTH);
 
   61     data.account_id_valid = 
true;
 
   64 OfxTransactionContainer::~OfxTransactionContainer()
 
   71   if (data.unique_id_valid == 
true && MainContainer != NULL)
 
   73     data.security_data_ptr = MainContainer->find_security(data.
unique_id);
 
   74     if (data.security_data_ptr != NULL)
 
   79   libofx_context->transactionCallback(data);
 
   86   if (MainContainer != NULL)
 
   88     return MainContainer->add_container(
this);
 
  100   if (identifier == 
"DTPOSTED")
 
  103     data.date_posted_valid = 
true;
 
  105   else if (identifier == 
"DTUSER")
 
  108     data.date_initiated_valid = 
true;
 
  110   else if (identifier == 
"DTAVAIL")
 
  113     data.date_funds_available_valid = 
true;
 
  115   else if (identifier == 
"FITID")
 
  117     strncpy(data.
fi_id, value.c_str(), 
sizeof(data.
fi_id));
 
  118     data.fi_id_valid = 
true;
 
  120   else if (identifier == 
"CORRECTFITID")
 
  123     data.fi_id_corrected_valid = 
true;
 
  125   else if (identifier == 
"CORRECTACTION")
 
  127     data.fi_id_correction_action_valid = 
true;
 
  128     if (value == 
"REPLACE")
 
  132     else if (value == 
"DELETE")
 
  138       data.fi_id_correction_action_valid = 
false;
 
  141   else if ((identifier == 
"SRVRTID") || (identifier == 
"SRVRTID2"))
 
  144     data.server_transaction_id_valid = 
true;
 
  146   else if (identifier == 
"MEMO" || identifier == 
"MEMO2")
 
  148     strncpy(data.
memo, value.c_str(), 
sizeof(data.
memo));
 
  149     data.memo_valid = 
true;
 
  158 void OfxTransactionContainer::add_account(
OfxAccountData * account_data)
 
  160   if (account_data->account_id_valid == 
true)
 
  164     data.account_id_valid = 
true;
 
  172 OfxBankTransactionContainer::OfxBankTransactionContainer(
LibofxContext *p_libofx_context, 
OfxGenericContainer *para_parentcontainer, 
string para_tag_identifier):
 
  179   if ( identifier == 
"TRNTYPE")
 
  182     if (value == 
"CREDIT")
 
  186     else if (value == 
"DEBIT")
 
  190     else if (value == 
"INT")
 
  192       data.transactiontype = 
OFX_INT;
 
  194     else if (value == 
"DIV")
 
  196       data.transactiontype = 
OFX_DIV;
 
  198     else if (value == 
"FEE")
 
  200       data.transactiontype = 
OFX_FEE;
 
  202     else if (value == 
"SRVCHG")
 
  206     else if (value == 
"DEP")
 
  208       data.transactiontype = 
OFX_DEP;
 
  210     else if (value == 
"ATM")
 
  212       data.transactiontype = 
OFX_ATM;
 
  214     else if (value == 
"POS")
 
  216       data.transactiontype = 
OFX_POS;
 
  218     else if (value == 
"XFER")
 
  222     else if (value == 
"CHECK")
 
  226     else if (value == 
"PAYMENT")
 
  230     else if (value == 
"CASH")
 
  234     else if (value == 
"DIRECTDEP")
 
  238     else if (value == 
"DIRECTDEBIT")
 
  242     else if (value == 
"REPEATPMT")
 
  246     else if (value == 
"OTHER")
 
  255   else if (identifier == 
"TRNAMT")
 
  258     data.amount_valid = 
true;
 
  260     data.units_valid = 
true;
 
  262     data.unitprice_valid = 
true;
 
  264   else if (identifier == 
"CHECKNUM")
 
  267     data.check_number_valid = 
true;
 
  269   else if (identifier == 
"REFNUM")
 
  272     data.reference_number_valid = 
true;
 
  274   else if (identifier == 
"SIC")
 
  277     data.standard_industrial_code_valid = 
true;
 
  279   else if ((identifier == 
"PAYEEID") || (identifier == 
"PAYEEID2"))
 
  282     data.payee_id_valid = 
true;
 
  284   else if (identifier == 
"NAME")
 
  286     strncpy(data.
name, value.c_str(), 
sizeof(data.
name));
 
  287     data.name_valid = 
true;
 
  301 OfxInvestmentTransactionContainer::OfxInvestmentTransactionContainer(
LibofxContext *p_libofx_context, 
OfxGenericContainer *para_parentcontainer, 
string para_tag_identifier):
 
  308   data.invtransactiontype_valid = 
true;
 
  309   if (para_tag_identifier == 
"BUYDEBT")
 
  313   else if (para_tag_identifier == 
"BUYMF")
 
  317   else if (para_tag_identifier == 
"BUYOPT")
 
  321   else if (para_tag_identifier == 
"BUYOTHER")
 
  325   else if (para_tag_identifier == 
"BUYSTOCK")
 
  329   else if (para_tag_identifier == 
"CLOSUREOPT")
 
  333   else if (para_tag_identifier == 
"INCOME")
 
  337   else if (para_tag_identifier == 
"INVEXPENSE")
 
  341   else if (para_tag_identifier == 
"JRNLFUND")
 
  345   else if (para_tag_identifier == 
"JRNLSEC")
 
  349   else if (para_tag_identifier == 
"MARGININTEREST")
 
  353   else if (para_tag_identifier == 
"REINVEST")
 
  357   else if (para_tag_identifier == 
"RETOFCAP")
 
  361   else if (para_tag_identifier == 
"SELLDEBT")
 
  365   else if (para_tag_identifier == 
"SELLMF")
 
  369   else if (para_tag_identifier == 
"SELLOPT")
 
  373   else if (para_tag_identifier == 
"SELLOTHER")
 
  377   else if (para_tag_identifier == 
"SELLSTOCK")
 
  381   else if (para_tag_identifier == 
"SPLIT")
 
  385   else if (para_tag_identifier == 
"TRANSFER")
 
  391     message_out(
ERROR, 
"This should not happen, " + para_tag_identifier + 
" is an unknown investment transaction type");
 
  392     data.invtransactiontype_valid = 
false;
 
  398   if (identifier == 
"UNIQUEID")
 
  401     data.unique_id_valid = 
true;
 
  403   else if (identifier == 
"UNIQUEIDTYPE")
 
  406     data.unique_id_type_valid = 
true;
 
  408   else if (identifier == 
"UNITS")
 
  411     data.units_valid = 
true;
 
  413   else if (identifier == 
"UNITPRICE")
 
  416     data.unitprice_valid = 
true;
 
  418   else if (identifier == 
"MKTVAL")
 
  420     message_out(
DEBUG, 
"MKTVAL of " + value + 
" ignored since MKTVAL should always be UNITS*UNITPRICE");
 
  422   else if (identifier == 
"TOTAL")
 
  425     data.amount_valid = 
true;
 
  427   else if (identifier == 
"DTSETTLE")
 
  430     data.date_posted_valid = 
true;
 
  432   else if (identifier == 
"DTTRADE")
 
  435     data.date_initiated_valid = 
true;
 
  437   else if (identifier == 
"COMMISSION")
 
  440     data.commission_valid = 
true;
 
  442   else if (identifier == 
"FEES")
 
  445     data.fees_valid = 
true;
 
  447   else if (identifier == 
"OLDUNITS")
 
  450     data.oldunits_valid = 
true;
 
  452   else if (identifier == 
"NEWUNITS")
 
  455     data.newunits_valid = 
true;
 
An abstraction of an account. 
virtual int add_to_main_tree()
Add this container to the main tree. 
char reference_number[OFX_REFERENCE_NUMBER_LENGTH]
A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer. 
char unique_id[OFX_UNIQUE_ID_LENGTH]
char account_id[OFX_ACCOUNT_ID_LENGTH]
Represents a generic transaction. 
char fi_id_corrected[256]
char check_number[OFX_CHECK_NUMBER_LENGTH]
virtual void add_attribute(const string identifier, const string value)
Add data to a container object. 
int transactiontype_valid
char name[OFX_TRANSACTION_NAME_LENGTH]
char memo[OFX_MEMO2_LENGTH]
FiIdCorrectionAction fi_id_correction_action
virtual void add_attribute(const string identifier, const string value)
Add data to a container object. 
long int standard_industrial_code
char account_id[OFX_ACCOUNT_ID_LENGTH]
int message_out(OfxMsgType error_type, const string message)
Message output function. 
char account_id[OFX_ACCOUNT_ID_LENGTH]
void add_attribute(const string identifier, const string value)
Add data to a container object. 
time_t ofxdate_to_time_t(const string ofxdate)
Convert a C++ string containing a time in OFX format to a C time_t. 
double ofxamount_to_double(const string ofxamount)
Convert OFX amount of money to double float. 
struct OfxAccountData * account_ptr
char server_transaction_id[OFX_SVRTID2_LENGTH]
void add_attribute(const string identifier, const string value)
Add data to a container object. 
Various simple functions for type conversion & al. 
Represents a statement for either a bank account or a credit card account. 
char payee_id[OFX_SVRTID2_LENGTH]
LibOFX internal object code. 
time_t date_funds_available
Message IO functionality. 
char unique_id_type[OFX_UNIQUE_ID_TYPE_LENGTH]
The root container. Created by the <OFX> OFX element or by the export functions. 
virtual int gen_event()
Generate libofx.h events.