LibOFX
|
Various simple functions for type conversion & al. More...
Go to the source code of this file.
Macros | |
#define | DIRSEP "/" |
Functions | |
std::string | CharStringtostring (const SGMLApplication::CharString source) |
Convert OpenSP CharString to a C++ STL string. | |
void | AppendCharStringtostring (const SGMLApplication::CharString source, std::string &dest) |
Append an OpenSP CharString to an existing C++ STL string. | |
time_t | ofxdate_to_time_t (const std::string &ofxdate) |
Convert a C++ string containing a time in OFX format to a C time_t. More... | |
double | ofxamount_to_double (const std::string ofxamount) |
Convert OFX amount of money to double float. More... | |
std::string | strip_whitespace (const std::string para_string) |
Sanitize a string coming from OpenSP. More... | |
std::string | get_tmp_dir () |
int | mkTempFileName (const char *tmpl, char *buffer, unsigned int size) |
Various simple functions for type conversion & al.
Definition in file ofx_utilities.cpp.
double ofxamount_to_double | ( | const std::string | ofxamount | ) |
Convert OFX amount of money to double float.
Convert a C++ string containing an amount of money as specified by the OFX standard and convert it to a double float.
Definition at line 130 of file ofx_utilities.cpp.
Referenced by OfxBalanceContainer::add_attribute(), OfxSecurityContainer::add_attribute(), OfxPositionContainer::add_attribute(), OfxBankTransactionContainer::add_attribute(), and OfxInvestmentTransactionContainer::add_attribute().
time_t ofxdate_to_time_t | ( | const std::string & | ofxdate | ) |
Convert a C++ string containing a time in OFX format to a C time_t.
Converts a date from the YYYYMMDDHHMMSS.XXX[gmt offset:tz name] OFX format (see OFX 2.01 spec p.66) to a C time_t.
ofxdate | date from the YYYYMMDDHHMMSS.XXX[gmt offset:tz name] OFX format |
Definition at line 68 of file ofx_utilities.cpp.
Referenced by OfxBalanceContainer::add_attribute(), OfxStatementContainer::add_attribute(), OfxSecurityContainer::add_attribute(), OfxPositionContainer::add_attribute(), OfxTransactionContainer::add_attribute(), and OfxInvestmentTransactionContainer::add_attribute().
std::string strip_whitespace | ( | const std::string | para_string | ) |
Sanitize a string coming from OpenSP.
Many weird characters can be present inside a SGML element, as a result on the transfer protocol, or for any reason. This function greatly enhances the reliability of the library by zapping those gremlins (backspace,formfeed,newline,carriage return, horizontal and vertical tabs) as well as removing whitespace at the beginning and end of the string. Otherwise, many problems will occur during stringmatching.
Definition at line 153 of file ofx_utilities.cpp.
Referenced by OFCApplication::endElement(), and OFXApplication::endElement().