Google
Web alhem.net
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

BlackAdder.h

Go to the documentation of this file.
00001 
00006 /*
00007 Copyright (C) 2004  Anders Hedstrom
00008 
00009 This program is free software; you can redistribute it and/or
00010 modify it under the terms of the GNU General Public License
00011 as published by the Free Software Foundation; either version 2
00012 of the License, or (at your option) any later version.
00013 
00014 This program is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 GNU General Public License for more details.
00018 
00019 You should have received a copy of the GNU General Public License
00020 along with this program; if not, write to the Free Software
00021 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 */
00023 #ifndef _BLACKADDER_H
00024 #define _BLACKADDER_H
00025 
00026 #include <list>
00027 
00028         typedef std::vector<std::string> string_v;
00029         typedef std::map<std::string,std::string> strstr_m;
00030 
00031 
00032 typedef struct
00033 {
00034         std::string name; // classname
00035         std::string group_name;
00036         std::string m_namespace;
00037         std::string filename;
00038         int line;
00039         bool bExtern;
00040         bool bUsed;
00041         string_v bases; // basklasser
00042         string_v using_type;
00043         std::string color;
00044 } CLS;
00045 
00046 
00047         typedef std::map<std::string,std::vector<std::string> > typedef_m;
00048 
00049 typedef struct
00050 {
00051         std::string name; // space
00052         std::vector<CLS *> added; // klasser
00053         typedef_m typedefs;
00054 } NSP;
00055 
00056 
00057 
00058 class BlackAdder
00059 {
00060 public:
00061         BlackAdder();
00062         ~BlackAdder();
00063 
00064         CLS *add_class(const std::string& ,string_v& ,const std::string& ,int,bool);
00065         NSP *GetNamespace(const std::string& name,bool add = true);
00066         void MakeDot(const std::string& group_name = "");
00067         void add_using(const std::string& );
00068         void clear_using();
00069         void add_type(CLS *,const std::string& );
00070         void set_typedef(const std::string& nspace,const std::string& ,std::vector<std::string>&);
00071         bool type_lookup(CLS *,const std::string& typ,string_v&,NSP *&);
00072         bool is_class(const std::string& nspace,const std::string& name);
00073 
00074 private:
00075         void fix_class();
00076         CLS *find_class(const std::string& ,const std::string& );
00077         bool locate(NSP *base,const char *,NSP *&,CLS *&,bool add = true);
00078         bool has_subclass(NSP *nsp0, CLS *cls0, const std::string& color);
00079         std::list<CLS *> find_base(NSP *nsp, CLS *cls);
00080         void find_color(NSP *nsp, CLS *cls);
00081         CLS *find_class(const std::string& name0);
00082         //
00083         std::vector<NSP *> m_added; // namespaces
00084         strstr_m m_using;
00085 //      typedef_m m_typedef;
00086 };
00087 
00088 
00089 #endif // _BLACKADDER_H

Generated for My SDL C++ Gui by doxygen 1.3.6