LibOFX

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

- File List
- Globals

ofx_container_generic.cpp
Go to the documentation of this file.
1 /***************************************************************************
2 ofx_container_generic.cpp
3 -------------------
4 copyright : (C) 2002 by Benoit Gr�goire
5 email : benoitg@coeus.ca
6 ***************************************************************************/
10 /***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19 #ifdef HAVE_CONFIG_H
20 #include <config.h>
21 #endif
22
23 #include <string>
24 #include "ParserEventGeneratorKit.h"
25 #include "messages.hh"
26 #include "libofx.h"
27 #include "ofx_containers.hh"
28
29 extern OfxMainContainer * MainContainer;
30
31 OfxGenericContainer::OfxGenericContainer(LibofxContext *p_libofx_context)
32 {
33 parentcontainer = NULL;
34 type = "";
35 tag_identifier = "";
36 libofx_context = p_libofx_context;
37 }
38 OfxGenericContainer::OfxGenericContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer)
39 {
40 libofx_context = p_libofx_context;
41 parentcontainer = para_parentcontainer;
42 if (parentcontainer != NULL && parentcontainer->type == "DUMMY")
43 {
44 message_out(DEBUG, "OfxGenericContainer(): The parent is a DummyContainer!");
45 }
46 }
47 OfxGenericContainer::OfxGenericContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier)
48 {
49 libofx_context = p_libofx_context;
50 parentcontainer = para_parentcontainer;
51 tag_identifier = para_tag_identifier;
52 if (parentcontainer != NULL && parentcontainer->type == "DUMMY")
53 {
54 message_out(DEBUG, "OfxGenericContainer(): The parent for this " + tag_identifier + " is a DummyContainer!");
55 }
56 }
57 void OfxGenericContainer::add_attribute(const string identifier, const string value)
58 {
59 /*If an attribute has made it all the way up to the Generic Container's add_attribute,
60 we don't know what to do with it! */
61 message_out(ERROR, "WRITEME: " + identifier + " (" + value + ") is not supported by the " + type + " container");
62 }
63 OfxGenericContainer* OfxGenericContainer::getparent()
64 {
65 return parentcontainer;
66 }
67
68 int OfxGenericContainer::gen_event()
69 {
70 /* No callback is ever generated for pure virtual containers */
71 return false;
72 }
73
74 int OfxGenericContainer::add_to_main_tree()
75 {
76 if (MainContainer != NULL)
77 {
78 return MainContainer->add_container(this);
79 }
80 else
81 {
82 return false;
83 }
84 }
85
OfxGenericContainer::getparent
OfxGenericContainer * getparent()
Returns the parent container object (the one representing the containing OFX SGML element) ...
Definition: ofx_container_generic.cpp:63
OfxGenericContainer
A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer.
Definition: ofx_containers.hh:33
OfxGenericContainer::add_attribute
virtual void add_attribute(const string identifier, const string value)
Add data to a container object.
Definition: ofx_container_generic.cpp:57
LibofxContext
Definition: context.hh:25
message_out
int message_out(OfxMsgType error_type, const string message)
Message output function.
Definition: messages.cpp:60
DEBUG
Definition: messages.hh:25
ERROR
Definition: messages.hh:34
OfxGenericContainer::tag_identifier
string tag_identifier
Definition: ofx_containers.hh:37
OfxGenericContainer::add_to_main_tree
virtual int add_to_main_tree()
Add this container to the main tree.
Definition: ofx_container_generic.cpp:74
OfxGenericContainer::gen_event
virtual int gen_event()
Generate libofx.h events.
Definition: ofx_container_generic.cpp:68
OfxGenericContainer::type
string type
Definition: ofx_containers.hh:36
ofx_containers.hh
LibOFX internal object code.
messages.hh
Message IO functionality.
OfxMainContainer
The root container. Created by the <OFX> OFX element or by the export functions.
Definition: ofx_containers.hh:247