LibOFX: OfxGenericContainer Class Reference

LibOFX

Public Member Functions | Data Fields
OfxGenericContainer Class Reference

A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer. More...

Inheritance diagram for OfxGenericContainer:

## Public Member Functions
| OfxGenericContainer (LibofxContext *p_libofx_context)
| OfxGenericContainer (LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer)
| OfxGenericContainer (LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, std::string para_tag_identifier)
virtual void | add_attribute (const std::string identifier, const std::string value)
| Add data to a container object. More...
virtual int | gen_event ()
| Generate libofx.h events. More...
virtual int | add_to_main_tree ()
| Add this container to the main tree. More...
OfxGenericContainer * | getparent ()
| Returns the parent container object (the one representing the containing OFX SGML element)

## Data Fields
std::string | type
std::string | tag_identifier
OfxGenericContainer * | parentcontainer
LibofxContext * | libofx_context

## Detailed Description

A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer.

A hierarchy of containers is built as the file is parsed. The supported OFX elements all have a matching container. The others are assigned a OfxDummyContainer, so every OFX element creates a container as the file is par Note however that containers are destroyed as soon as the corresponding SGML element is closed.

Definition at line 31 of file ofx_containers.hh.

## Member Function Documentation

## ◆ add_attribute()

void OfxGenericContainer::add_attribute | ( | const std::string | identifier,
|  | const std::string | value
| ) |  |
| virtual

Add data to a container object.

Must be called once completed parsing an OFX SGML data element. The parent container should know what to do with it.

Parameters

  identifier | The name of the data element
  value | The concatenated string of the data

Reimplemented in OfxInvestmentTransactionContainer, OfxBankTransactionContainer, OfxTransactionContainer, OfxPositionContainer, OfxSecurityContainer, OfxAccountContainer, OfxStatementContainer, OfxBalanceContainer, OfxStatusContainer, OfxPushUpContainer, OfxInv401kContainer, and OfxDummyContainer.

Definition at line 57 of file ofx_container_generic.cpp.

Referenced by OfxInv401kContainer::add_attribute(), OfxPushUpContainer::add_attribute(), OfxStatusContainer::add_attribute(), OfxBalanceContainer::add_attribute(), OfxStatementContainer::add_attribute(), OfxAccountContainer::add_attribute(), OfxSecurityContainer::add_attribute(), OfxPositionContainer::add_attribute(), OfxTransactionContainer::add_attribute(), OFCApplication::endElement(), and OFXApplication::endElement().

## ◆ add_to_main_tree()

int OfxGenericContainer::add_to_main_tree | ( |  | ) |
| virtual

Add this container to the main tree.

add_to_main_treegen_event will add the container to the main trees stored int the OfxMainContainer.

Returns
  true if successful, false otherwise.

Reimplemented in OfxTransactionContainer, OfxPositionContainer, OfxSecurityContainer, OfxAccountContainer, and OfxStatementContainer.

Definition at line 74 of file ofx_container_generic.cpp.

## ◆ gen_event()

int OfxGenericContainer::gen_event | ( |  | ) |
| virtual

Generate libofx.h events.

gen_event will call the appropriate ofx_proc_XXX_cb defined in libofx.h if one is available.

Returns
  true if a callback function vas called, false otherwise.

Reimplemented in OfxMainContainer, OfxTransactionContainer, OfxPositionContainer, OfxSecurityContainer, OfxAccountContainer, and OfxStatementContainer.

Definition at line 68 of file ofx_container_generic.cpp.

## Field Documentation

## ◆ tag_identifier

std::string OfxGenericContainer::tag_identifier

The identifier of the creating tag

Definition at line 42 of file ofx_containers.hh.

Referenced by OfxDummyContainer::add_attribute(), OfxInv401kContainer::add_attribute(), OFCApplication::endElement(), and OFXApplication::endElement().

## ◆ type

std::string OfxGenericContainer::type

The type of the object, often == tag_identifier

Definition at line 41 of file ofx_containers.hh.

Referenced by add_attribute(), OfxStatusContainer::add_attribute(), OFCApplication::endElement(), and OFXApplication::endElement().

The documentation for this class was generated from the following files:

- ofx_containers.hh
- ofx_container_generic.cpp