WIP refractoring
This commit is contained in:
24
main.cpp
24
main.cpp
@ -1,8 +1,8 @@
|
||||
#include "headers/Park_spot.h"
|
||||
#include "thirdparty/SQLiteCpp/include/SQLiteCpp/SQLiteCpp.h"
|
||||
#include "headers/data.h"
|
||||
#include <iostream>
|
||||
#include <thread> // to make pausing work, not sure if i need chrono, or this, or both
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
/*
|
||||
Code strucure like this:
|
||||
@ -19,22 +19,16 @@ record die zegt dat een customer voor x tijd geparkeert heeft bij spot x, enz.
|
||||
De client clockt in en uit bij een spot.
|
||||
*/
|
||||
|
||||
void Wait(int sec)
|
||||
/*
|
||||
a wait function where 1 sec represents 1 hour irl.
|
||||
*/
|
||||
{
|
||||
std::this_thread::sleep_for(seconds{sec});
|
||||
}
|
||||
|
||||
using std::cout;
|
||||
|
||||
int main() {
|
||||
SQLite::Statement test(data::db, "SELECT * FROM Customer WHERE id > 2");
|
||||
while (test.executeStep()){
|
||||
int id = test.getColumn(0);
|
||||
std::string name = test.getColumn(1);
|
||||
cout << id << ", " << name << std::endl;
|
||||
|
||||
}
|
||||
|
||||
SQLite::Database db = data::start_db();
|
||||
// see implementation of update_db, save_db and delete_db of customer to see how queries and statements work
|
||||
Customer sagar{"Sagar Winston Ramsaransing", Verhicle_type::medium, db};
|
||||
sagar.update_db(db);
|
||||
cout << "THIS WRKS";
|
||||
// sagar.delete_db(db);
|
||||
}
|
||||
|
Reference in New Issue
Block a user