Eneboo - Documentación para desarrolladores
tools/aqods/odf-gen/odstype.h
Ir a la documentación de este archivo.
00001 /*
00002 odf-gen: Simple API to generate OpenDocument documents.
00003     Copyright (C) 2009  Pablo Jorge, FuDePAN
00004 
00005     This file is part of the odf-gen project.
00006 
00007     odf-gen is free software: you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation, either version 3 of the License, or
00010     (at your option) any later version.
00011 
00012     odf-gen is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with odf-gen.  If not, see <http://www.gnu.org/licenses/>.
00019 */
00020 
00021 #ifndef ODSTYPE_H
00022 #define ODSTYPE_H
00023 
00024 template <class T>
00025 struct ODSType
00026 {
00027     static const char* convert() { return "float"; }
00028 };
00029 
00030 template <class T>
00031 struct ODSType<const T&> : public ODSType<T>
00032 {};
00033 
00034 #define MAP_ODS_TYPE(cpptype, odstype) \
00035 template<> \
00036 struct ODSType<cpptype> \
00037 { \
00038     static const char* convert() { return #odstype; } \
00039 };
00040 
00041 MAP_ODS_TYPE(const char*, string);
00042 MAP_ODS_TYPE(std::string, string);
00043 
00044 template <int N>
00045 struct ODSType<char[N]>
00046 {
00047     static const char* convert() { return "string"; }
00048 };
00049 
00050 #endif // ODSTYPE_H
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'