C:/GCC/docs/DocSqlite/wxSqlite/wx_SQLite.h

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 // procedure acces DDS
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  // 1= entier  2 = num  3 = text  4 = Date  5 = blod(pas trt)
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; // N°index key
00044 };
00045 // Key index -> DDS
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;    // descandant key = 1
00055    int Sel;     // selection  = 1  >= 0
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;     // descandant key = 1
00067    int Sel;      // selection  = 1  >= 0
00068 };
00069 
00070 
00071 //     const int KEY = 00 ; // position enum (swicht = 00 )
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 ;  // Déf Data Structure
00081  std::vector<KID>   ki ;  // Key Index
00082  std::vector<KLF>   lg ;  // Key Index Logique
00083  int  slg[10];             // N° ordre de zone for Logique  where
00084  int  klg[10];             // N° ordre de zone for Logique  Key ASC
00085  wxString BD ;
00086  bool     OpnBD;
00087  } DDS_FILE;
00088 
00089 
00090  public:
00091    wx_SQL() ;
00092    virtual ~wx_SQL();
00093 // erreur
00094 bool  wx_SQL::F_Berr(){return Berr;};
00095 const wxString wx_SQL::F_Merr(){return Merr;};
00096 
00097 // initialisation des definitions Fields
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 // Initialisation Index
00102 void wx_SQL::F_Index(int nField, wxString nameField,
00103 wxString valeurField,bool keyField , int ordrefield);
00104 // Initialisation Index pour lecture Logique
00105 void wx_SQL::L_Index(int nField, wxString nameField,
00106 wxString valeurField,bool keyField , int ordrefield);
00107 
00108 // initialisation des Logiques
00109 void wx_SQL::L_ValLGF( int i ,const wxString V_field = wxT(""));
00110 
00111 // lecture des fields pour wxString
00112 const wxString  wx_SQL:: F_GetDDS( int i );
00113 // initialisation des fields pour wxString
00114 void  wx_SQL::F_SetDDS( int i ,const wxString V_field );
00115 // Open file .db3
00116 void  wx_SQL::F_OpnDDS(wxString Fpath);
00117 // fonction de creation Sqlite File  field
00118 wxString wx_SQL::F_CrtDDS(wxString Fname);
00119 // fonction de creation Sqlite File  Index
00120 const wxString  wx_SQL::F_IdxDDS(wxString Fname);
00121 // initialisation  de la base de données
00122 bool wx_SQL::F_CrtTable(wxString Fname, bool index = false);
00123 //  INSERT BD
00124 bool wx_SQL::F_WrtDDS(wxString Fname);
00125 //  UPDATE DB
00126 bool wx_SQL::F_UpdDDS(wxString Fname);
00127 //  UPDATE BD ( 1 Field)
00128 bool wx_SQL::F_UpdDDSx(wxString Fname,unsigned int x);
00129 //DELETE DB
00130 bool wx_SQL::F_DltDDS(wxString Fname);
00131 // Stell Index Unique
00132 bool wx_SQL::F_ChainDDS(wxString Fname);
00133 
00134 //*********************************************************
00135 //*********************************************************
00136 // Gestion Lecture sur logique
00137 //*********************************************************
00138 //*********************************************************
00139 
00140 // Setll  read *all
00141 bool L_RallDDS(wxString Fname);
00142 // Setll  read *GE
00143 bool L_ReadGeDDS(wxString Fname);
00144 // Setll  readp *LE
00145 bool L_ReadpLeDDS(wxString Fname);
00146 };
00147 #endif // WX_SQLITE_H_INCLUDED

Generated on Fri Aug 4 18:17:15 2006 for wx_Sqlite by  doxygen 1.4.6-NO