/*
* Copyright(c)Fellixombc 2010
*
* TextToSqlRs 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.
*
* TextToSqlRs 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 TextToSqlRs. If not, see <http://www.gnu.org/licenses/>.
*/
#include <ctime>
#include <iostream>
#include <unistd.h>
#include <string>
#include "eMysql.h"
#include "manage.h"
usingnamespace std;
int main() {
time_t start, stop;
double TIME;
string host, user, password, database;
string path;
bool run = true;
int runtime;
int MAX;
int max;
cout << "Please enter the required information." << endl << "Absolute path to character folder: ";
cin >> path;
cout << "MySql Database Host: ";
cin >> host;
cout << "MySql Username: ";
cin >> user;
cout << "MySql Password: ";
cin >> password;
cout << "Database name: ";
cin >> database;
start = clock();
eMysql* m = new eMysql;
Manage* manage = new Manage;
m->connect(host.c_str(), user.c_str(), password.c_str(), database.c_str());
manage->ReadDir(path);
manage->TextToSql(m);
delete manage;
delete m;
stop = clock();
TIME = ((double)stop - (double)start)/CLOCKS_PER_SEC;
cout << "Finished in " << TIME << " seconds" << endl;
}