LibOFX: ofx_preproc.hh File Reference

LibOFX

Macros | Functions
ofx_preproc.hh File Reference

Preprocessing of the OFX files before parsing. More...

Go to the source code of this file.

## Macros
#define | OPENSPDCL_FILENAME "opensp.dcl"
#define | OFX160DTD_FILENAME "ofx160.dtd"
#define | OFCDTD_FILENAME "ofc.dtd"

## Functions
string | sanitize_proprietary_tags (string input_string)
| Removes proprietary tags and comments. More...
std::string | find_dtd (LibofxContextPtr ctx, const std::string &dtd_filename)
| Find the appropriate DTD for the file version. More...
int | ofx_proc_file (LibofxContextPtr libofx_context, const char *)
| ofx_proc_file process an ofx or ofc file. More...

## Detailed Description

Preprocessing of the OFX files before parsing.

Implements the pre-treatement of the OFX file prior to parsing: OFX header striping, OFX proprietary tags and SGML comment striping, locating the appropriate DTD.

Definition in file ofx_preproc.hh.

## Function Documentation

## ◆ find_dtd()

std::string find_dtd | ( | LibofxContextPtr | ctx,
|  | const std::string & | dtd_filename
| ) |  |

Find the appropriate DTD for the file version.

This function will try to find a DTD matching the requested_version and return the full path of the DTD found (or an empty string if unsuccessful)

Please note that currently the function will ALWAYS look for version 160, since OpenSP can't parse the 201 DTD correctly

It will look, in (order)

1- The environment variable OFX_DTD_PATH (if present) 2- On windows only, a relative path specified by get_dtd_installation_directory() 3- The path specified by the makefile in MAKEFILE_DTD_PATH, thru LIBOFX_DTD_DIR in configure (if present) 4- Any hardcoded paths in DTD_SEARCH_PATH

Definition at line 551 of file ofx_preproc.cpp.

## ◆ ofx_proc_file()

int ofx_proc_file | ( | LibofxContextPtr | ctx,
|  | const char * | p_filename
| ) |  |

ofx_proc_file process an ofx or ofc file.

libofx_proc_file must be called with a list of 1 or more OFX files to be parsed in command line format.

ofx_proc_file process an ofx or ofc file.

Takes care of comment striping, dtd locating, etc.

Definition at line 81 of file ofx_preproc.cpp.

## ◆ sanitize_proprietary_tags()

string sanitize_proprietary_tags | ( | string | input_string | ) |

Removes proprietary tags and comments.

This function will strip all the OFX proprietary tags and SGML comments from the SGML string passed to it Note this function assumes in case a proprietary tag comes in an open and closing pair, they both appear on the same line (and hence are part of the same input_string passed to this function). So an ofx file with a single line like this <proprietary>abc</proprietary> will properly sanitized But an ofx file where this is split on multiple lines will not: <proprietary> abc </proprietary>

Definition at line 478 of file ofx_preproc.cpp.