00001
00002
00003
00004
00005
00006
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifdef HAVE_CONFIG_H
00020 #include <config.h>
00021 #endif
00022
00023 #include <string>
00024 #include "ParserEventGeneratorKit.h"
00025 #include "messages.hh"
00026 #include "libofx.h"
00027 #include "ofx_containers.hh"
00028
00029 extern OfxMainContainer * MainContainer;
00030
00031 OfxGenericContainer::OfxGenericContainer(LibofxContext *p_libofx_context)
00032 {
00033 parentcontainer=NULL;
00034 type="";
00035 tag_identifier="";
00036 libofx_context = p_libofx_context;
00037 }
00038 OfxGenericContainer::OfxGenericContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer)
00039 {
00040 libofx_context = p_libofx_context;
00041 parentcontainer = para_parentcontainer;
00042 if(parentcontainer!=NULL&&parentcontainer->type=="DUMMY"){
00043 message_out(DEBUG,"OfxGenericContainer(): The parent is a DummyContainer!");
00044 }
00045 }
00046 OfxGenericContainer::OfxGenericContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier)
00047 {
00048 libofx_context = p_libofx_context;
00049 parentcontainer = para_parentcontainer;
00050 tag_identifier = para_tag_identifier;
00051 if(parentcontainer!=NULL&&parentcontainer->type=="DUMMY"){
00052 message_out(DEBUG,"OfxGenericContainer(): The parent for this "+tag_identifier+" is a DummyContainer!");
00053 }
00054 }
00055 void OfxGenericContainer::add_attribute(const string identifier, const string value)
00056 {
00057
00058
00059 message_out(ERROR, "WRITEME: "+identifier+" ("+value+") is not supported by the "+type+" container");
00060 }
00061 OfxGenericContainer* OfxGenericContainer::getparent()
00062 {
00063 return parentcontainer;
00064 }
00065
00066 int OfxGenericContainer::gen_event()
00067 {
00068
00069 return false;
00070 }
00071
00072 int OfxGenericContainer::add_to_main_tree()
00073 {
00074 if(MainContainer != NULL)
00075 {
00076 return MainContainer->add_container(this);
00077 }
00078 else
00079 {
00080 return false;
00081 }
00082 }
00083