39 memset(&data, 0,
sizeof(data));
46 if (para_tag_identifier ==
"CCACCTFROM")
50 data.account_type = data.OFX_CREDITCARD;
51 data.account_type_valid =
true;
53 if (para_tag_identifier ==
"INVACCTFROM")
57 data.account_type = data.OFX_INVESTMENT;
58 data.account_type_valid =
true;
60 if (parentcontainer != NULL && ((
OfxStatementContainer*)parentcontainer)->data.currency_valid ==
true)
62 strncpy(data.currency, ((
OfxStatementContainer*)parentcontainer)->data.currency, OFX_CURRENCY_LENGTH);
63 data.currency_valid =
true;
66 OfxAccountContainer::~OfxAccountContainer()
77 if ( identifier ==
"BANKID")
79 strncpy(bankid, value.c_str(), OFX_BANKID_LENGTH);
80 data.bank_id_valid =
true;
81 strncpy(data.bank_id, value.c_str(), OFX_BANKID_LENGTH);
83 else if ( identifier ==
"BRANCHID")
85 strncpy(branchid, value.c_str(), OFX_BRANCHID_LENGTH);
86 data.branch_id_valid =
true;
87 strncpy(data.branch_id, value.c_str(), OFX_BRANCHID_LENGTH);
89 else if ( identifier ==
"ACCTID")
91 strncpy(acctid, value.c_str(), OFX_ACCTID_LENGTH);
92 data.account_number_valid =
true;
93 strncpy(data.account_number, value.c_str(), OFX_ACCTID_LENGTH);
95 else if ( identifier ==
"ACCTKEY")
97 strncpy(acctkey, value.c_str(), OFX_ACCTKEY_LENGTH);
99 else if ( identifier ==
"BROKERID")
101 strncpy(brokerid, value.c_str(), OFX_BROKERID_LENGTH);
102 data.broker_id_valid =
true;
103 strncpy(data.broker_id, value.c_str(), OFX_BROKERID_LENGTH);
105 else if ((identifier ==
"ACCTTYPE") || (identifier ==
"ACCTTYPE2"))
107 data.account_type_valid =
true;
108 if (value ==
"CHECKING")
110 data.account_type = data.OFX_CHECKING;
112 else if (value ==
"SAVINGS")
114 data.account_type = data.OFX_SAVINGS;
116 else if (value ==
"MONEYMRKT")
118 data.account_type = data.OFX_MONEYMRKT;
120 else if (value ==
"CREDITLINE")
122 data.account_type = data.OFX_CREDITLINE;
124 else if (value ==
"CMA")
126 data.account_type = data.OFX_CMA;
131 data.account_type_valid =
false;
143 libofx_context->accountCallback(data);
151 if (MainContainer != NULL)
153 return MainContainer->add_container(
this);
161 void OfxAccountContainer::gen_account_id(
void)
165 strncat(data.account_id, acctid, OFX_ACCOUNT_ID_LENGTH - strlen(data.account_id));
166 strncat(data.account_id,
" ", OFX_ACCOUNT_ID_LENGTH - strlen(data.account_id));
167 strncat(data.account_id, acctkey, OFX_ACCOUNT_ID_LENGTH - strlen(data.account_id));
169 strncat(data.account_name,
"Credit card ", OFX_ACCOUNT_NAME_LENGTH - strlen(data.account_name));
170 strncat(data.account_name, acctid, OFX_ACCOUNT_NAME_LENGTH - strlen(data.account_name));
174 strncat(data.account_id, brokerid, OFX_ACCOUNT_ID_LENGTH - strlen(data.account_id));
175 strncat(data.account_id,
" ", OFX_ACCOUNT_ID_LENGTH - strlen(data.account_id));
176 strncat(data.account_id, acctid, OFX_ACCOUNT_ID_LENGTH - strlen(data.account_id));
178 strncat(data.account_name,
"Investment account ", OFX_ACCOUNT_NAME_LENGTH - strlen(data.account_name));
179 strncat(data.account_name, acctid, OFX_ACCOUNT_NAME_LENGTH - strlen(data.account_name));
180 strncat(data.account_name,
" at broker ", OFX_ACCOUNT_NAME_LENGTH - strlen(data.account_name));
181 strncat(data.account_name, brokerid, OFX_ACCOUNT_NAME_LENGTH - strlen(data.account_name));
185 strncat(data.account_id, bankid, OFX_ACCOUNT_ID_LENGTH - strlen(data.account_id));
186 strncat(data.account_id,
" ", OFX_ACCOUNT_ID_LENGTH - strlen(data.account_id));
187 strncat(data.account_id, branchid, OFX_ACCOUNT_ID_LENGTH - strlen(data.account_id));
188 strncat(data.account_id,
" ", OFX_ACCOUNT_ID_LENGTH - strlen(data.account_id));
189 strncat(data.account_id, acctid, OFX_ACCOUNT_ID_LENGTH - strlen(data.account_id));
191 strncat(data.account_name,
"Bank account ", OFX_ACCOUNT_NAME_LENGTH - strlen(data.account_name));
192 strncat(data.account_name, acctid, OFX_ACCOUNT_NAME_LENGTH - strlen(data.account_name));
196 data.account_id_valid =
true;
A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer.
Various simple functions for type conversion & al.
LibOFX internal object code.
virtual int gen_event()
Generate libofx.h events.
virtual void add_attribute(const string identifier, const string value)
Add data to a container object.
void add_attribute(const string identifier, const string value)
Add data to a container object.
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.
Message IO functionality.
The root container. Created by the <OFX> OFX element or by the export functions.