/* * dtata.h * Copyright (C) 2023 Leonardo de Araújo Lima * * dstorage is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * dstorage is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #ifndef _DTATA_H_ #define _DTATA_H_ #include #include #include #include #include #include #include "sqlite3.h" using namespace std; class sdata { public: // variables, data members. int nitens = 0; int debug = 1; int nreg =0; char *zErrMsg = 0; const char* data = "Callback function called"; vector iname; vector idata; // methods. sdata(); // default constructor. ~sdata(); // default destructor. int citens(); int show(); void set_db(const char *name); void set_tb(const char *name); void set_dpath(const char *path); int dbinfo(); int add_data(const char *n, const char *d); int tsize(); int nsize(); int vsize(); void dbtest(); int cDBase(); bool addreg(); int cnreg(); int objid = 1; bool load(); static int callback(void *unused, int count, char **data, char **columns); protected: const char *dpath = " "; const char *dbn = " "; const char *tbn = " "; private: sqlite3* db; int dsize = 0; }; #endif // _DTATA_H_