CPPSERV


Home Projects Jobs Clientele Contact
CPPSERV Documentation Download TODO Mailing lists Bug tracker News RSS Feed Browse source

Taglib.h

Go to the documentation of this file.
00001 /*
00002  *  Copyright (C) 2005 Krzysztof Rzymkowski <rzymek@users.sourceforge.net>
00003  *  Copyright (C) 2008 Ilya A. Volynets-Evenbach <ilya@total-knowledge.com>
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; version 2 of the License.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00017  */
00018 
00019 #ifndef TAG_TAGLIB_H
00020 #define TAG_TAGLIB_H
00021 
00022 #include <iostream>
00023 #include <map>
00024 #include <string>
00025 
00026 namespace servlet
00027 {
00028 namespace taglib
00029 {
00030 
00031 typedef std::multimap<std::string, std::string> attribs_t;
00032 class Generator;
00033 
00034 class Taglib
00035 {
00036 private:
00037     std::string m_prefix;
00038 protected:
00039     void setPrefix(const std::string& prefix)
00040     { m_prefix = prefix; }
00041 public:
00042     Taglib(const std::string& prefix);
00043     virtual ~Taglib();
00044     virtual Generator* getTag(const std::string& name) = 0;
00045     virtual void releaseTag(Generator*) = 0;
00046     const std::string& getPrefix() const;
00047 };
00048 
00049 } // namespace taglib
00050 } // namespace servlet
00051 
00059 #define EXPORT_TAGLIB(name,class) \
00060     extern "C" { \
00061         servlet::taglib::Taglib* create_taglib_##name(const servlet::taglib::attribs_t& attribs) \
00062         { \
00063             return new class(#name, attribs); \
00064         } \
00065     }
00066 
00067 
00068 
00069 #endif//TAG_TAGLIB_H
00070 

SourceForge.net Logo