context.hh
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef CONTEXT_H
#define CONTEXT_H
#include <string.h>
#include <time.h> // for time_t
#include "libofx.h"
#include "ParserEventGeneratorKit.h"
#include <string>
class LibofxContext
{
private:
LibofxFileFormat _current_file_type;
LibofxProcStatusCallback _statusCallback;
LibofxProcAccountCallback _accountCallback;
LibofxProcSecurityCallback _securityCallback;
LibofxProcTransactionCallback _transactionCallback;
LibofxProcStatementCallback _statementCallback;
LibofxProcPositionCallback _positionCallback;
void * _statementData;
void * _accountData;
void * _transactionData;
void * _securityData;
void * _statusData;
void * _positionData;
std::string _dtdDir;
public:
LibofxContext();
~LibofxContext();
LibofxFileFormat currentFileType() const;
void setCurrentFileType(LibofxFileFormat t);
const std::string &dtdDir() const
{
return _dtdDir;
};
void setDtdDir(const std::string &s)
{
_dtdDir = s;
};
int statementCallback(const struct OfxStatementData data);
int accountCallback(const struct OfxAccountData data);
int transactionCallback(const struct OfxTransactionData data);
int securityCallback(const struct OfxSecurityData data);
int statusCallback(const struct OfxStatusData data);
int positionCallback(const struct OfxPositionData data);
void setStatusCallback(LibofxProcStatusCallback cb, void *user_data);
void setAccountCallback(LibofxProcAccountCallback cb, void *user_data);
void setSecurityCallback(LibofxProcSecurityCallback cb, void *user_data);
void setTransactionCallback(LibofxProcTransactionCallback cb, void *user_data);
void setStatementCallback(LibofxProcStatementCallback cb, void *user_data);
void setPositionCallback(LibofxProcPositionCallback cb, void *user_data);
};//End class LibofxContext
#endif
OfxSecurityData
An abstraction of a security, such as a stock, mutual fund, etc.
Definition: inc/libofx.h:369
OfxTransactionData
An abstraction of a transaction in an account.
Definition: inc/libofx.h:693
OfxAccountData
An abstraction of an account.
Definition: inc/libofx.h:287
LibofxProcStatementCallback
int(* LibofxProcStatementCallback)(const struct OfxStatementData data, void *statement_data)
The callback function for the OfxStatementData structure.
Definition: inc/libofx.h:1153
OfxStatusData
An abstraction of an OFX STATUS element.
Definition: inc/libofx.h:225
OfxStatementData
An abstraction of an account statement.
Definition: inc/libofx.h:1068
LibofxFileFormat
LibofxFileFormat
Definition: inc/libofx.h:137
LibofxContext
Definition: context.hh:23
LibofxProcTransactionCallback
int(* LibofxProcTransactionCallback)(const struct OfxTransactionData data, void *transaction_data)
The callback function for the OfxTransactionData structure.
Definition: inc/libofx.h:1057
LibofxProcStatusCallback
int(* LibofxProcStatusCallback)(const struct OfxStatusData data, void *status_data)
The callback function for the OfxStatusData structure.
Definition: inc/libofx.h:274
LibofxProcSecurityCallback
int(* LibofxProcSecurityCallback)(const struct OfxSecurityData data, void *security_data)
The callback function for the OfxSecurityData structure.
Definition: inc/libofx.h:631
LibofxProcAccountCallback
int(* LibofxProcAccountCallback)(const struct OfxAccountData data, void *account_data)
The callback function for the OfxAccountData structure.
Definition: inc/libofx.h:360
LibofxProcPositionCallback
int(* LibofxProcPositionCallback)(const struct OfxPositionData data, void *position_data)
The callback function for the OfxPositionData structure.
Definition: inc/libofx.h:1281
OfxPositionData
An abstraction of a security position held in an account.
Definition: inc/libofx.h:1172