00001 #ifndef WX_SQLITE_H_INCLUDED
00002 #define WX_SQLITE_H_INCLUDED
00003
00005 #include <vector>
00006 #include <wx/wxSqlite/wxsqlite3.h>
00007
00008 using namespace std;
00009
00010
00011
00012
00013 enum Type_Zone {
00014 xInt = 1,
00015 xDbl = 2,
00016 xText = 3,
00017 xDate = 4,
00018 xBlod = 5
00019 };
00020
00021
00022 class wx_SQL
00023 {
00024 private:
00025 wxString Merr ;
00026 bool Berr ;
00027 wxString Xsql ;
00028
00029
00030 struct DDS
00031 {
00032 DDS(int f, wxString n,wxString v, int t, int l, int e, int p ,bool k , int o )
00033 : field(f), Name(n), wxVal(v), Type(t) , Lng(l), Ent(e), Prs(p) , Key(k), Ord(o){}
00034
00035 int field;
00036 wxString Name;
00037 wxString wxVal;
00038 int Type;
00039 int Lng;
00040 int Ent ;
00041 int Prs;
00042 bool Key;
00043 int Ord;
00044 };
00045
00046 struct KID
00047 {
00048 KID(int f, wxString n ,wxString v, int d , int s)
00049 : field(f), Name(n), wxVal(v), Desc(d), Sel(s) {}
00050
00051 int field;
00052 wxString Name;
00053 wxString wxVal;
00054 int Desc;
00055 int Sel;
00056 };
00057
00058 struct KLF
00059 {
00060 KLF(int f, wxString n ,wxString v, int d, int s)
00061 : field(f), Name(n), wxVal(v), Desc(d), Sel(s) {}
00062
00063 int field;
00064 wxString Name;
00065 wxString wxVal;
00066 int Desc;
00067 int Sel;
00068 };
00069
00070
00071
00072 public:
00073
00074 struct F_FILE{
00075 wxSQLite3Database db;
00076 wxSQLite3ResultSet qry;
00077 wxSQLite3Statement stm;
00078 wxSQLite3Table tbl;
00079
00080 std::vector<DDS> ds ;
00081 std::vector<KID> ki ;
00082 std::vector<KLF> lg ;
00083 int slg[10];
00084 int klg[10];
00085 wxString BD ;
00086 bool OpnBD;
00087 } DDS_FILE;
00088
00089
00090 public:
00091 wx_SQL() ;
00092 virtual ~wx_SQL();
00093
00094 bool wx_SQL::F_Berr(){return Berr;};
00095 const wxString wx_SQL::F_Merr(){return Merr;};
00096
00097
00098 void wx_SQL::F_Field(int nField, wxString nameField,wxString valeurField,
00099 int typeField, int lenField, int entierField =0,
00100 int precisionField =0,bool keyField = false , int ordrefield = 0);
00101
00102 void wx_SQL::F_Index(int nField, wxString nameField,
00103 wxString valeurField,bool keyField , int ordrefield);
00104
00105 void wx_SQL::L_Index(int nField, wxString nameField,
00106 wxString valeurField,bool keyField , int ordrefield);
00107
00108
00109 void wx_SQL::L_ValLGF( int i ,const wxString V_field = wxT(""));
00110
00111
00112 const wxString wx_SQL:: F_GetDDS( int i );
00113
00114 void wx_SQL::F_SetDDS( int i ,const wxString V_field );
00115
00116 void wx_SQL::F_OpnDDS(wxString Fpath);
00117
00118 wxString wx_SQL::F_CrtDDS(wxString Fname);
00119
00120 const wxString wx_SQL::F_IdxDDS(wxString Fname);
00121
00122 bool wx_SQL::F_CrtTable(wxString Fname, bool index = false);
00123
00124 bool wx_SQL::F_WrtDDS(wxString Fname);
00125
00126 bool wx_SQL::F_UpdDDS(wxString Fname);
00127
00128 bool wx_SQL::F_UpdDDSx(wxString Fname,unsigned int x);
00129
00130 bool wx_SQL::F_DltDDS(wxString Fname);
00131
00132 bool wx_SQL::F_ChainDDS(wxString Fname);
00133
00134
00135
00136
00137
00138
00139
00140
00141 bool L_RallDDS(wxString Fname);
00142
00143 bool L_ReadGeDDS(wxString Fname);
00144
00145 bool L_ReadpLeDDS(wxString Fname);
00146 };
00147 #endif // WX_SQLITE_H_INCLUDED