Página principal | Lista alfabética | Lista de componentes | Lista de archivos | Miembros de las clases | Archivos de los miembros | Páginas relacionadas

Archivero.hpp

Ir a la documentación de este archivo.
00001 
00006 /*
00007    MUnDoCAAD MUD Engine
00008    Copyright (C) 2002-2005 José Manuel Ferrer Ortiz
00009 
00010    *****************************************************************************
00011    *                                                                           *
00012    *  This program is free software; you can redistribute it and/or modify it  *
00013    *  under the terms of the GNU General Public License version 2, as          *
00014    *  published by the Free Software Foundation.                               *
00015    *                                                                           *
00016    *  This program is distributed in the hope that it will be useful, but      *
00017    *  WITHOUT ANY WARRANTY; without even the implied warranty of               *
00018    *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU         *
00019    *  General Public License version 2 for more details.                       *
00020    *                                                                           *
00021    *  You should have received a copy of the GNU General Public License        *
00022    *  version 2 along with this program; if not, write to the Free Software    *
00023    *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA  *
00024    *                                                                           *
00025    *****************************************************************************
00026 */
00027 
00028 
00029 #ifndef _ARCHIVERO_HPP
00030 #define _ARCHIVERO_HPP
00031 
00032 #include <QCache>
00033 #include <QDomDocument>
00034 
00035 
00037 #define TAM_CCACHE 64
00038 
00039 #define TAM_RCACHE 16
00040 
00041 
00042 // Modos de una propiedad:
00044 #define MODO_RUTINA   0
00045 
00046 #define MODO_VARIABLE 1
00047 
00048 // Tipos de una propiedad:
00050 #define TIPO_NADA     0
00051 
00052 #define TIPO_BOOLEANO 1
00053 
00054 #define TIPO_ENTERO   2
00055 
00056 #define TIPO_CADENA   3
00057 
00058 
00060 class Archivero
00061 {
00062   public:
00063     Archivero  ();  // Constructor
00064     ~Archivero ();  // Destructor
00065 
00066     unsigned char DaModoPropiedad (const QString &nom_ent,
00067                                    const QString &nom_prop);
00068     QString       DaPropiedad     (const QString &nom_ent,
00069                                    const QString &nom_prop);
00070     unsigned char DaTipoPropiedad (const QString &nom_ent,
00071                                    const QString &nom_prop);
00072 
00073   private:
00075     struct Propiedad
00076     {
00077       // Identificadores de la propiedad (los necesitaremos para poder
00078       // guardarla a disco)
00079 
00081       QString entidad;
00083       QString nombre;
00084 
00086       QString *contenido;
00087 
00089       unsigned modo : 1;
00091       unsigned tipo : 2;
00092 
00094       unsigned modificada : 1;
00095 
00096       // Constructor
00097       Propiedad  (const QString &nom_ent, const QString &nom_prop);
00098       ~Propiedad ();  // Destructor
00099 
00100       void GuardaPropiedad();
00101     };
00102 
00107     QCache<QString, Propiedad> ccache;
00112     QCache<QString, QString>   rcache;
00113 
00114     QString          BuscaPropiedad (const QString &nom_ent,
00115                                      const QString &nom_prop);
00116     bool             CargaDocumento (QDomDocument &documento,
00117                                      const QString &nom_ent);
00118     Propiedad       *LeePropiedad   (const QString &nom_ent,
00119                                      const QString &nom_prop);
00120     const Propiedad *ObtenPropiedad (const QString &nom_ent,
00121                                      const QString &nom_prop);
00122 };
00123 
00124 
00125 QString FiltroLecturaBooleano   (const QString &original, bool &error);
00126 QString FiltroLecturaCadena     (const QString &original, bool &error);
00127 QString FiltroLecturaEntero     (const QString &original, bool &error);
00128 QString FiltroLecturaRutina     (const QString &original);
00129 QString FiltroEscrituraBooleano (const QString &original);
00130 QString FiltroEscrituraCadena   (const QString &original);
00131 QString FiltroEscrituraEntero   (const QString &original);
00132 QString FiltroEscrituraRutina   (const QString &original);
00133 
00134 #endif  // _ARCHIVERO_HPP

Generado el Tue Nov 29 01:04:33 2005 para MUnDoCAAD MUD Engine por  doxygen 1.4.4