/* * new.main.cpp * 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 . */ /* # Copyright 2022 Leonardo de Araújo Lima # # This program 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. # This program 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 http://www.gnu.org/licenses/. # # # # */ #include #include "sdata.h" int main() { sdata monka; monka.debug = 0; /* monka.add_data ("nome", "Leonardo"); monka.add_data ("sobrenome", "de Araújo Lima"); monka.add_data ("email", "leonardo@asl-sl.com.br"); monka.add_data ("website", "www.asl-sl.com.br"); monka.add_data ("telefone", "(35) 3331-2320"); */ monka.set_dpath("/home/leonardo/databases/"); monka.set_db("sData.db"); monka.set_tb("info"); // monka.show(); size_t s = monka.tsize(); s = monka.nsize(); cout << "\n size of data keys : " << s << " bytes." << endl; s = monka.vsize(); cout << "\n size of data values : " << s << " bytes." << endl; monka.debug=0; // cout << "\n size of object data : " << s << " bytes." << endl; // s = monka.nsize(); // cout << "\n size of data keys : " << s << " bytes." << endl; monka.dbinfo(); monka.dbtest(); monka.debug = 0; cout << "\nloading..." << endl; bool t = monka.load(); cout << t << endl; cout << "\ndata loaded..." << endl; // monka.load(); // monka.show(); return 0; }