Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

defs.hh

00001 /*
00002 *  Name:      defs.hh
00003 *  Author:    Angel Jimenez Jimenez
00004 *             Rafael Jesus Alcantara Perez
00005 *  Summary:   HTML definitions
00006 *  Date:      $Date: 2003/04/14 00:18:34 $
00007 *  Revision:  $Revision: 1.1 $
00008 *
00009 *  Copyright (C) 1994-2002  Rafael Jesus Alcantara Perez <rafa@dedalo-ing.com>
00010 *
00011 *  This program is free software; you can redistribute it and/or modify
00012 *  it under the terms of the GNU General Public License as published by
00013 *  the Free Software Foundation; either version 2 of the License, or
00014 *  (at your option) any later version.
00015 *
00016 *  This program is distributed in the hope that it will be useful,
00017 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 *  GNU General Public License for more details.
00020 *
00021 *  You should have received a copy of the GNU General Public License
00022 *  along with this program; if not, write to the Free Software
00023 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00024 *  MA 02111-1307, USA.
00025 */
00026 
00027 #ifndef _MPCL_TEXT_HTML_DEFS__
00028 #define _MPCL_TEXT_HTML_DEFS__
00029 
00030 #include <functional>
00031 #include "exceptions.hh"
00032 
00033 
00035 namespace mpcl
00036 {
00037 
00039   namespace text
00040   {
00041 
00047     namespace html
00048     {
00049 
00050       //
00051       //  E X P O R T E D   V A R I A B L E S
00052       //
00053 
00055       extern const char*   pkcDefaultBodyId;
00056 
00058       extern const char*   pkcDefaultFramesetId;
00059 
00061       extern const char*   pkcDefaultHeadId;
00062 
00064       extern const char*   pkcDefaultTitleId;
00065 
00067       extern const char*   pkcTypeTextCss;
00068 
00070       extern const char   kcIdentifierSeparator;
00071 
00073       extern const char   kcIdentifierValueSeparator;
00074 
00075 
00076       //
00077       //  E X P O R T E D   F U N C T I O N   O B J E C T S
00078       //
00079 
00084       template <typename TTargetIdentifier, typename TSourceItem>
00085       struct MMatchPairIdentifier : public std::unary_function<TSourceItem, bool>
00086       {
00087 
00088         public:
00089 
00091           TTargetIdentifier   tTargetIdentifier;
00092 
00093 
00094         public:
00095 
00096           //
00097           //  C O N S T R U C T O R S
00098           //
00099 
00103           MMatchPairIdentifier (void) :
00104             tTargetIdentifier()       {}
00105 
00110           MMatchPairIdentifier (const TTargetIdentifier& rktTARGET_IDENTIFIER) :
00111             tTargetIdentifier (rktTARGET_IDENTIFIER)                           {}
00112 
00117           void setTarget (const TTargetIdentifier& rktTARGET_IDENTIFIER)
00118           {
00119             tTargetIdentifier = rktTARGET_IDENTIFIER;
00120           }
00121 
00126           bool operator () (const TSourceItem& rktSOURCE_ITEM)
00127           {
00128             return ( rktSOURCE_ITEM.second->identifier() == tTargetIdentifier );
00129           }
00130 
00131       };  // struct MMatchPairIdentifier
00132 
00137       template <typename TTargetItem, typename TSourceItem>
00138       struct MWriteIdentifierTo : public std::unary_function<TTargetItem, void>
00139       {
00140 
00141         public:
00142 
00144           TTargetItem&   rtTargetItem;
00145 
00146 
00147         public:
00148 
00149           //
00150           //  C O N S T R U C T O R S
00151           //
00152 
00158           MWriteIdentifierTo (TTargetItem& rtTARGET_ITEM) :
00159             rtTargetItem (rtTARGET_ITEM)                  {}
00160 
00165           void operator () (TSourceItem& rtSOURCE_ITEM)
00166           {
00167             rtTargetItem << rtSOURCE_ITEM->identifier() << endl;
00168           }
00169 
00174           void operator () (const TSourceItem& rktSOURCE_ITEM)
00175           {
00176             rtTargetItem << rktSOURCE_ITEM->identifier() << endl;
00177           }
00178 
00179       };  // struct MWriteIdentifierTo
00180 
00181     }  // namespace html
00182 
00183   }  // namespace text
00184 
00185 }  // namespace mpcl
00186 
00187 
00188 #endif  // not _MPCL_TEXT_HTML_DEFS__

Generated on Mon Oct 13 02:35:23 2003 for MPCL by doxygen1.2.18