39 memset(&data, 0,
sizeof(data));
42 if (para_tag_identifier ==
"STOCKINFO")
43 data.security_type = data.OFX_STOCK_SECURITY;
44 else if (para_tag_identifier ==
"MFINFO")
45 data.security_type = data.OFX_FUND_SECURITY;
46 else if (para_tag_identifier ==
"OPTINFO")
47 data.security_type = data.OFX_OPTION_SECURITY;
48 else if (para_tag_identifier ==
"DEBTINFO")
49 data.security_type = data.OFX_DEBT_SECURITY;
51 ASSIGN(data.security_type, data.OFX_OTHER_SECURITY);
53OfxSecurityContainer::~OfxSecurityContainer()
59 if (identifier ==
"UNIQUEID")
65 if (data.unique_id_valid ==
false)
75 else if (identifier ==
"UNIQUEIDTYPE")
81 if (data.unique_id_type_valid ==
false)
91 else if (identifier ==
"SECNAME")
95 else if (identifier ==
"TICKER")
99 else if (identifier ==
"RATING")
103 else if (identifier ==
"UNITPRICE")
107 else if (identifier ==
"DTASOF")
111 else if (identifier ==
"CURRATE")
115 else if (identifier ==
"CURSYM")
119 else if (identifier ==
"CURRENCY")
123 else if (identifier ==
"ORIGCURRENCY")
127 else if (identifier ==
"MEMO" || identifier ==
"MEMO2")
131 else if (identifier ==
"FIID")
135 else if (identifier ==
"ASSETCLASS")
137 if (value ==
"DOMESTICBOND")
139 ASSIGN(data.asset_class, data.OFX_ASSET_CLASS_DOMESTICBOND);
141 else if (value ==
"INTLBOND")
143 ASSIGN(data.asset_class, data.OFX_ASSET_CLASS_INTLBOND);
145 else if (value ==
"LARGESTOCK")
147 ASSIGN(data.asset_class, data.OFX_ASSET_CLASS_LARGESTOCK);
149 else if (value ==
"SMALLSTOCK")
151 ASSIGN(data.asset_class, data.OFX_ASSET_CLASS_SMALLSTOCK);
153 else if (value ==
"INTLSTOCK")
155 ASSIGN(data.asset_class, data.OFX_ASSET_CLASS_INTLSTOCK);
157 else if (value ==
"MONEYMRKT")
159 ASSIGN(data.asset_class, data.OFX_ASSET_CLASS_MONEYMRKT);
161 else if (value ==
"OTHER")
163 ASSIGN(data.asset_class, data.OFX_ASSET_CLASS_OTHER);
166 else if (identifier ==
"PARVALUE")
170 else if (identifier ==
"DEBTTYPE")
172 if (value ==
"COUPON")
174 ASSIGN(data.debt_type, data.OFX_DEBT_TYPE_COUPON);
176 else if (value ==
"ZERO")
178 ASSIGN(data.debt_type, data.OFX_DEBT_TYPE_ZERO);
181 else if (identifier ==
"DEBTCLASS")
183 if (value ==
"TREASURY")
185 ASSIGN(data.debt_class, data.OFX_DEBTCLASS_TREASURY);
187 else if (value ==
"MUNICIPAL")
189 ASSIGN(data.debt_class, data.OFX_DEBTCLASS_MUNICIPAL);
191 else if (value ==
"CORPORATE")
193 ASSIGN(data.debt_class, data.OFX_DEBTCLASS_CORPORATE);
195 else if (value ==
"OTHER")
197 ASSIGN(data.debt_class, data.OFX_DEBTCLASS_OTHER);
200 else if (identifier ==
"COUPONRT")
204 else if (identifier ==
"DTCOUPON")
208 else if (identifier ==
"COUPONFREQ")
210 if (value ==
"MONTHLY")
212 ASSIGN(data.coupon_freq, data.OFX_COUPON_FREQ_MONTHLY);
214 else if (value ==
"QUARTERLY")
216 ASSIGN(data.coupon_freq, data.OFX_COUPON_FREQ_QUARTERLY);
218 else if (value ==
"SEMIANNUAL")
220 ASSIGN(data.coupon_freq, data.OFX_COUPON_FREQ_SEMIANNUAL);
222 else if (value ==
"ANNUAL")
224 ASSIGN(data.coupon_freq, data.OFX_COUPON_FREQ_ANNUAL);
226 else if (value ==
"OTHER")
228 ASSIGN(data.coupon_freq, data.OFX_COUPON_FREQ_OTHER);
231 else if (identifier ==
"CALLPRICE")
235 else if (identifier ==
"YIELDTOCALL")
239 else if (identifier ==
"DTCALL")
243 else if (identifier ==
"CALLTYPE")
247 ASSIGN(data.call_type, data.OFX_CALL_TYPE_CALL);
249 else if (value ==
"PUT")
251 ASSIGN(data.call_type, data.OFX_CALL_TYPE_PUT);
253 else if (value ==
"PREFUND")
255 ASSIGN(data.call_type, data.OFX_CALL_TYPE_PREFUND);
257 else if (value ==
"MATURITY")
259 ASSIGN(data.call_type, data.OFX_CALL_TYPE_MATURITY);
262 else if (identifier ==
"YIELDTOMAT")
266 else if (identifier ==
"DTMAT")
270 else if (identifier ==
"MFTYPE")
272 if (value ==
"OPENEND")
274 ASSIGN(data.mutual_fund_type, data.OFX_MFTYPE_OPENEND);
276 else if (value ==
"CLOSEEND")
278 ASSIGN(data.mutual_fund_type, data.OFX_MFTYPE_CLOSEEND);
280 else if (value ==
"OTHER")
282 ASSIGN(data.mutual_fund_type, data.OFX_MFTYPE_OTHER);
285 else if (identifier ==
"STOCKTYPE")
287 if (value ==
"COMMON")
289 ASSIGN(data.stock_type, data.OFX_STOCKTYPE_COMMON);
291 else if (value ==
"PREFERRED")
293 ASSIGN(data.stock_type, data.OFX_STOCKTYPE_PREFERRED);
295 else if (value ==
"CONVERTIBLE")
297 ASSIGN(data.stock_type, data.OFX_STOCKTYPE_CONVERTIBLE);
299 else if (value ==
"OTHER")
301 ASSIGN(data.stock_type, data.OFX_STOCKTYPE_OTHER);
304 else if (identifier ==
"YIELD")
308 else if (identifier ==
"DTYIELDASOF")
312 else if (identifier ==
"OPTTYPE")
314 if (value ==
"CALL" || value ==
"Call")
316 ASSIGN(data.option_type, data.OFX_OPTION_TYPE_CALL);
318 else if (value ==
"PUT" || value ==
"Put")
320 ASSIGN(data.option_type, data.OFX_OPTION_TYPE_PUT);
323 else if (identifier ==
"STRIKEPRICE")
327 else if (identifier ==
"DTEXPIRE")
331 else if (identifier ==
"SHPERCTRCT")
343 libofx_context->securityCallback(data);
349 if (MainContainer != NULL)
351 return MainContainer->add_container(
this);
A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer.
virtual 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.
virtual int gen_event()
Generate libofx.h events.
void add_attribute(const string identifier, const string value)
Add data to a container object.
virtual int add_to_main_tree()
Add this container to the main tree.
Main header file containing the LibOfx API.
Message IO functionality.
LibOFX internal object code.
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.
Various simple functions for type conversion & al.
#define ASSIGN_STRNCPY(DEST, VALUE)
#define ASSIGN(DEST, VALUE)
char unique_id[OFX_UNIQUE_ID_LENGTH]
char fiid[OFX_FIID_LENGTH]
char unique_id2[OFX_UNIQUE_ID_LENGTH]
char currency[OFX_CURRENCY_LENGTH]
char secname[OFX_SECNAME_LENGTH]
int amounts_are_foreign_currency
char rating[OFX_SECURITY_RATING_LENGTH]
char unique_id2_type[OFX_UNIQUE_ID_TYPE_LENGTH]
char unique_id_type[OFX_UNIQUE_ID_TYPE_LENGTH]
char memo[OFX_MEMO2_LENGTH]
char ticker[OFX_TICKER_LENGTH]