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

convtipos.hpp

Go to the documentation of this file.
00001 
00002 //
00003 // Fichero            : convtipos.hpp
00004 // Autor              : Cesar Ortiz
00005 // Fecha creacion     : 
00006 // 
00007 // Descripcion        : Conversiones de tipos
00008 //
00009 // 
00010 // Notas
00011 //    - 
00012 //
00014 #ifndef UTIL_CONVTIPOS_H
00015 #define UTIL_CONVERSION_H
00016 
00017 #include "jic/exc/excepcion.hpp"
00018 #include <string>
00019 
00020 namespace UTIL {
00021 
00022   EXCEPCION(ExcConvTipos);
00023 
00024   class Int
00025   {
00026   public:
00027     Int(int i = 0) : _v(i) {}
00028 
00029     operator int() const { return _v; }
00030 
00031   private:
00032     int _v;
00033   };
00034   
00035   class ConvTipos {
00036   public:
00037     static bool string2Int(const std::string& cadena, int& numero);
00038     static bool string2char(const std::string& cadena, char& c);
00039     static int string2Int(const std::string& cadena) /*throw(UTIL::ExcConvTipos)*/;
00040     static char string2char(const std::string& cadena) /*throw(UTIL::ExcConvTipos)*/;
00041   private:
00042     static bool isDigitsString(const std::string &cadena,int base = 10);    
00043     static bool isBase10String(const std::string &cadena);    
00044     static bool isBase2String(const std::string &cadena);    
00045     static bool isBase8String(const std::string &cadena);    
00046     static bool isBase16String(const std::string &cadena);    
00047   };
00048 
00049   
00050 
00051 }
00052 
00053 istream& operator>>(std::istream& is, UTIL::Int& v)
00054          /*throw(UTIL::ExcConvTipos)*/;
00055 
00056 #endif /* UTIL_CONVTIPOS_H */
00057 

Generated on Wed Mar 5 21:31:47 2003 for JIC by doxygen1.3-rc3