cstorage/ok_files/main.cpp
Leonardo de Araújo Lima 4079b2cd02 started!
2024-02-16 11:07:31 -03:00

78 lines
2.6 KiB
C++

/*
* dtata.cpp
* Copyright (C) 2023 Leonardo de Araújo Lima <leonardo@deb-horus.local>
*
* 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 <http://www.gnu.org/licenses/>.
*/
/*
# 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 <iostream>
#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("/home/leonardo/databases/sData.db");
monka.set_tb("info");
cout << "\nclass with debug level deactivated..." << endl;
// 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 << "class with debug level deactivated..." << endl;
// monka.show();
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.cDBase();
monka.debug = 1;
monka.addreg();
cout << "\nloading..." << endl;
bool t = monka.load();
cout << t << endl;
monka.show();
return 0;
}