LibOFX: ofx_preproc.cpp File Reference

- Main Page
- Namespaces
- Data Structures
- Files
- Related Pages

- File List
- Globals

# ofx_preproc.cpp File Reference

## 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.cpp.

Go to the source code of this file.

## Defines
#define | LIBOFX_DEFAULT_INPUT_ENCODING "CP1252"
#define | LIBOFX_DEFAULT_OUTPUT_ENCODING "UTF-8"
## Functions
CFCT int | ofx_proc_file (LibofxContextPtr ctx, const char *p_filename)
| ofx_proc_file process an ofx or ofc file.
CFCT int | libofx_proc_buffer (LibofxContextPtr ctx, const char *s, unsigned int size)
string | sanitize_proprietary_tags (string input_string)
| Removes proprietary tags and comments.
string | find_dtd (LibofxContextPtr ctx, string dtd_filename)
| Find the appropriate DTD for the file version.
## Variables
const int | DTD_SEARCH_PATH_NUM = 3
| The number of different paths to search for DTDs.
const char * | DTD_SEARCH_PATH [DTD_SEARCH_PATH_NUM]
| The list of paths to search for the DTDs.
const unsigned int | READ_BUFFER_SIZE = 1024

## Function Documentation

string find_dtd | ( | LibofxContextPtr | ctx,
|  | 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 unsuccessfull)

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

Definition at line 514 of file ofx_preproc.cpp.

Referenced by libofx_proc_buffer(), and ofx_proc_file().

CFCT int libofx_proc_buffer | ( | LibofxContextPtr | ctx,
|  | const char * | s,
|  | unsigned int | size |
| ) |  |  |

Parses the content of the given buffer.

Definition at line 280 of file ofx_preproc.cpp.

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

ofx_proc_file process an ofx or ofc file.

Takes care of comment striping, dtd locating, etc.

Definition at line 70 of file ofx_preproc.cpp.

Referenced by libofx_proc_file().

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

Definition at line 411 of file ofx_preproc.cpp.

Referenced by libofx_proc_buffer(), and ofx_proc_file().

## Variable Documentation

const char* DTD_SEARCH_PATH[DTD_SEARCH_PATH_NUM]

Initial value:

     {

      "/usr/local/share/libofx/dtd/",
      "/usr/share/libofx/dtd/",
      "~/"}

The list of paths to search for the DTDs.

Definition at line 57 of file ofx_preproc.cpp.

Referenced by find_dtd().