File: ofx_container_generic.cpp

package info (click to toggle)
libofx 1%3A0.8.2-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,764 kB
  • ctags: 21,113
  • sloc: sh: 8,771; cpp: 5,475; ansic: 2,208; makefile: 200; xml: 61
file content (83 lines) | stat: -rw-r--r-- 2,914 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/***************************************************************************
         ofx_container_generic.cpp 
                             -------------------
    copyright            : (C) 2002 by Benoit Grgoire
    email                : bock@step.polymtl.ca
***************************************************************************/
/**@file
 * \brief Implementation of OfxGenericContainer
*/
/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <string>
#include "ParserEventGeneratorKit.h"
#include "messages.hh"
#include "libofx.h"
#include "ofx_containers.hh"

extern OfxMainContainer * MainContainer;

OfxGenericContainer::OfxGenericContainer(LibofxContext *p_libofx_context)
{
  parentcontainer=NULL;
  type="";
  tag_identifier="";
  libofx_context = p_libofx_context;
}
OfxGenericContainer::OfxGenericContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer)
{
  libofx_context = p_libofx_context;
  parentcontainer = para_parentcontainer;
  if(parentcontainer!=NULL&&parentcontainer->type=="DUMMY"){
    message_out(DEBUG,"OfxGenericContainer(): The parent is a DummyContainer!");
  }
}
OfxGenericContainer::OfxGenericContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier)
{
  libofx_context = p_libofx_context;
  parentcontainer = para_parentcontainer;
  tag_identifier = para_tag_identifier;
  if(parentcontainer!=NULL&&parentcontainer->type=="DUMMY"){
    message_out(DEBUG,"OfxGenericContainer(): The parent for this "+tag_identifier+" is a DummyContainer!");
  }
}
void OfxGenericContainer::add_attribute(const string identifier, const string value)
{
  /*If an attribute has made it all the way up to the Generic Container's add_attribute, 
    we don't know what to do with it! */
    message_out(ERROR, "WRITEME: "+identifier+" ("+value+") is not supported by the "+type+" container");
}
OfxGenericContainer* OfxGenericContainer::getparent()
{
  return parentcontainer;
}

int  OfxGenericContainer::gen_event()
{
  /* No callback is ever generated for pure virtual containers */
  return false;
}

int  OfxGenericContainer::add_to_main_tree()
{
  if(MainContainer != NULL)
    {
      return MainContainer->add_container(this);
    }
  else
    {
      return false;
    }
}