Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals

ofx_container_generic.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002          ofx_container_generic.cpp 
00003                              -------------------
00004     copyright            : (C) 2002 by Benoit Grégoire
00005     email                : bock@step.polymtl.ca
00006 ***************************************************************************/
00010 /***************************************************************************
00011  *                                                                         *
00012  *   This program is free software; you can redistribute it and/or modify  *
00013  *   it under the terms of the GNU General Public License as published by  *
00014  *   the Free Software Foundation; either version 2 of the License, or     *
00015  *   (at your option) any later version.                                   *
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()
00032 {
00033   parentcontainer=NULL;
00034   type="";
00035   tag_identifier="";
00036 }
00037 OfxGenericContainer::OfxGenericContainer(OfxGenericContainer *para_parentcontainer)
00038 {
00039   parentcontainer = para_parentcontainer;
00040   if(parentcontainer!=NULL&&parentcontainer->type=="DUMMY"){
00041     message_out(DEBUG,"OfxGenericContainer(): The parent is a DummyContainer!");
00042   }
00043 }
00044 OfxGenericContainer::OfxGenericContainer(OfxGenericContainer *para_parentcontainer, string para_tag_identifier)
00045 {
00046   parentcontainer = para_parentcontainer;
00047   tag_identifier = para_tag_identifier;
00048   if(parentcontainer!=NULL&&parentcontainer->type=="DUMMY"){
00049     message_out(DEBUG,"OfxGenericContainer(): The parent for this "+tag_identifier+" is a DummyContainer!");
00050   }
00051 }
00052 void OfxGenericContainer::add_attribute(const string identifier, const string value)
00053 {
00054   /*If an attribute has made it all the way up to the Generic Container's add_attribute, 
00055     we don't know what to do with it! */
00056     message_out(ERROR, "WRITEME: "+identifier+" ("+value+") is not supported by the "+type+" container");
00057 }
00058 OfxGenericContainer* OfxGenericContainer::getparent()
00059 {
00060   return parentcontainer;
00061 }
00062 
00063 int  OfxGenericContainer::gen_event()
00064 {
00065   /* No callback is ever generated for pure virtual containers */
00066   return false;
00067 }
00068 
00069 int  OfxGenericContainer::add_to_main_tree()
00070 {
00071   if(MainContainer != NULL)
00072     {
00073       return MainContainer->add_container(this);
00074     }
00075   else
00076     {
00077       return false;
00078     }
00079 }
00080   

Generated on Fri Sep 12 00:35:46 2003 for LibOFX by doxygen 1.3.3