LibOFX

Functions | Variables
build/libofx-0.10.0/lib/file_preproc.cpp File Reference

File type detection, etc. More...

Go to the source code of this file.

## Functions
const char * | libofx_get_file_format_description (const struct LibofxFileFormatInfo format_list[], enum LibofxFileFormat file_format)
| get_file_format_description returns a string description of a LibofxFileType. More...
enum LibofxFileFormat | libofx_get_file_format_from_str (const struct LibofxFileFormatInfo format_list[], const char *file_type_string)
| libofx_get_file_type returns a proper enum from a file type string. More...
int | libofx_proc_file (LibofxContextPtr p_libofx_context, const char *p_filename, LibofxFileFormat p_file_type)
| libofx_proc_file is the entry point of the library. More...
enum LibofxFileFormat | libofx_detect_file_type (const char *p_filename)
| libofx_detect_file_type tries to analyze a file to determine it's format. More...

## Variables
const unsigned int | READ_BUFFER_SIZE = 1024

## Detailed Description

File type detection, etc.

Implements AutoDetection of file type, and handoff to specific parsers.

Definition in file build/libofx-0.10.0/lib/file_preproc.cpp.

## Function Documentation

## ◆ libofx_detect_file_type()

enum LibofxFileFormat libofx_detect_file_type | ( | const char * | p_filename | ) |

libofx_detect_file_type tries to analyze a file to determine it's format.

Parameters

  p_filename | File name of the file to process

Returns
  Detected file format, UNKNOWN if unsuccessfull.

Definition at line 101 of file build/libofx-0.10.0/lib/file_preproc.cpp.

Referenced by libofx_proc_file().

## ◆ libofx_get_file_format_description()

const char* libofx_get_file_format_description | ( | const struct LibofxFileFormatInfo | format_list[],
|  | enum LibofxFileFormat | file_format
| ) |  |

get_file_format_description returns a string description of a LibofxFileType.

The file format list in which the format should be looked up, usually LibofxImportFormatList or LibofxExportFormatList

The file format which should match one of the formats in the list.

Returns
  null terminated string suitable for debugging output or user communication.

Definition at line 37 of file build/libofx-0.10.0/lib/file_preproc.cpp.

Referenced by libofx_proc_file().

## ◆ libofx_get_file_format_from_str()

enum LibofxFileFormat libofx_get_file_format_from_str | ( | const struct LibofxFileFormatInfo | format_list[],
|  | const char * | file_type_string
| ) |  |

libofx_get_file_type returns a proper enum from a file type string.

The file format list in which the format string should be found, usually LibofxImportFormatList or LibofxExportFormatList

The string which contain the file format matching one of the format_name of the list.

Returns
  the file format, or UNKNOWN if the format wasn't recognised.

Definition at line 54 of file build/libofx-0.10.0/lib/file_preproc.cpp.

## ◆ libofx_proc_file()

int libofx_proc_file | ( | LibofxContextPtr | libofx_context,
|  | const char * | p_filename,
|  | enum LibofxFileFormat | ftype
| ) |  |

libofx_proc_file is the entry point of the library.

libofx_proc_file must be called by the client, with 1 OFX file to be parsed in command line format.

Returns
  0 on successful parsing, -1 on any error (see debug log)

Definition at line 67 of file build/libofx-0.10.0/lib/file_preproc.cpp.