#include <iostream>
#include "rdbModel/Tables/Datatype.h"
#include "facilities/Util.h"
#include "facilities/Timestamp.h"
Go to the source code of this file.
Namespaces | |
namespace | rdbModel |
Enumerations | |
enum | TYPE_OF_TYPE { TOTinteger = 0, TOTreal, TOTchar, TOTdate } |
Functions | |
void | init () |
int | findType (std::string aType) |
int | findTOT (Datatype::TYPES aType) |
Variables | |
bool | initDone = false |
const unsigned int | N_SUPPORTED_TYPES = rdbModel::Datatype::TYPEchar + 1 |
std::string | typenames [N_SUPPORTED_TYPES] |
enum TYPE_OF_TYPE |
Definition at line 36 of file Datatype.cxx.
00036 { 00037 TOTinteger = 0, 00038 TOTreal, 00039 TOTchar, 00040 TOTdate 00041 };
int @2::findTOT | ( | Datatype::TYPES | aType | ) | [static] |
Definition at line 42 of file Datatype.cxx.
References TOTchar, TOTinteger, and TOTreal.
Referenced by rdbModel::Datatype::isCompatible().
00042 { 00043 if ((aType == Datatype::TYPEint) || (aType == Datatype::TYPEmediumint) || 00044 (aType == Datatype::TYPEsmallint)) return TOTinteger; 00045 else if ((aType == Datatype::TYPEreal) || (aType == Datatype::TYPEdouble)) 00046 return TOTreal; 00047 else if ((aType == Datatype::TYPEdatetime) || 00048 (aType == Datatype::TYPEtimestamp)) 00049 return TOTdate; 00050 else return TOTchar; 00051 }
int @2::findType | ( | std::string | aType | ) | [static] |
Definition at line 29 of file Datatype.cxx.
References genRecEmupikp::i, and init.
Referenced by rdbModel::Datatype::setType().
00029 { 00030 if (!initDone) init(); 00031 for (unsigned int i = 0; i < N_SUPPORTED_TYPES; i++) { 00032 if (aType == typenames[i]) return i; 00033 } 00034 return (int) Datatype::TYPEnotFound; 00035 }
void @2::init | ( | ) | [static] |
Definition at line 14 of file Datatype.cxx.
References deljobs::string.
00014 { 00015 if (!initDone) { 00016 typenames[Datatype::TYPEenum] = std::string("enum"); 00017 typenames[Datatype::TYPEdatetime] = std::string("datetime"); 00018 typenames[Datatype::TYPEtimestamp] = std::string("timestamp"); 00019 typenames[Datatype::TYPEint] = std::string("int"); 00020 typenames[Datatype::TYPEmediumint] = std::string("mediumint"); 00021 typenames[Datatype::TYPEsmallint] = std::string("smallint"); 00022 typenames[Datatype::TYPEreal] = std::string("real"); 00023 typenames[Datatype::TYPEdouble] = std::string("double"); 00024 typenames[Datatype::TYPEvarchar] = std::string("varchar"); 00025 typenames[Datatype::TYPEchar] = std::string("char"); 00026 initDone = true; 00027 } 00028 }
Definition at line 11 of file Datatype.cxx.
const unsigned int N_SUPPORTED_TYPES = rdbModel::Datatype::TYPEchar + 1 [static] |
Definition at line 12 of file Datatype.cxx.
std::string typenames[N_SUPPORTED_TYPES] [static] |