added opening creating a database
b5cc0c0 parent: 8780556 modified
.gitignore +2 -1 | @@ -1,2 +1,3 @@ | ||
| 1 | 1 | *.vscode* |
| 2 | -hello | |
| \ No newline at end of file | ||
| 2 | +build/* | |
| 3 | +*sqlite* | |
| \ No newline at end of file | ||
| @@ -1,2 +1,3 @@ | |||
| 1 | *.vscode* | 1 | *.vscode* |
| 2 | -hello | ||
| \ No newline at end of file | \ No newline at end of file | ||
| 2 | +build/* | ||
| 3 | +*sqlite* | ||
| \ No newline at end of file | \ No newline at end of file | ||
added
CMakeLists.txt +9 -0 | new file mode 100644 | ||
| @@ -0,0 +1,9 @@ | ||
| 1 | +cmake_minimum_required(VERSION 3.10) | |
| 2 | +project(fluffy) | |
| 3 | + | |
| 4 | +set(CMAKE_CXX_STANDARD 11) | |
| 5 | +set(CMAKE_CXX_STANDARD_REQUIRED True) | |
| 6 | + | |
| 7 | +include_directories(${CMAKE_SOURCE_DIR}/include) | |
| 8 | + | |
| 9 | +add_executable(fluffy src/main.cpp src/sqlite3.c) | |
| \ No newline at end of file | ||
| new file mode 100644 | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | +cmake_minimum_required(VERSION 3.10) | ||
| 2 | +project(fluffy) | ||
| 3 | + | ||
| 4 | +set(CMAKE_CXX_STANDARD 11) | ||
| 5 | +set(CMAKE_CXX_STANDARD_REQUIRED True) | ||
| 6 | + | ||
| 7 | +include_directories(${CMAKE_SOURCE_DIR}/include) | ||
| 8 | + | ||
| 9 | +add_executable(fluffy src/main.cpp src/sqlite3.c) | ||
| \ No newline at end of file | \ No newline at end of file | ||
deleted
main.cpp +0 -10 | deleted file mode 100644 | ||
| @@ -1,10 +0,0 @@ | ||
| 1 | -#include <iostream> | |
| 2 | -#include <string> | |
| 3 | -#include <cstdlib> | |
| 4 | - | |
| 5 | -const char* gamePath = ""; | |
| 6 | - | |
| 7 | -int main() { | |
| 8 | - std::cout << "Hello" << std::endl; | |
| 9 | - system(gamePath); | |
| 10 | -} | |
| \ No newline at end of file | ||
| deleted file mode 100644 | |||
| @@ -1,10 +0,0 @@ | |||
| 1 | -#include <iostream> | ||
| 2 | -#include <string> | ||
| 3 | -#include <cstdlib> | ||
| 4 | - | ||
| 5 | -const char* gamePath = ""; | ||
| 6 | - | ||
| 7 | -int main() { | ||
| 8 | - std::cout << "Hello" << std::endl; | ||
| 9 | - system(gamePath); | ||
| 10 | -} | ||
| \ No newline at end of file | \ No newline at end of file | ||
added
src/main.cpp +25 -0 | new file mode 100644 | ||
| @@ -0,0 +1,25 @@ | ||
| 1 | +#include <iostream> | |
| 2 | +#include <string> | |
| 3 | +#include <cstdlib> | |
| 4 | +#include <../include/sqlite3.h> | |
| 5 | + | |
| 6 | +const char* gamePath = ""; | |
| 7 | + | |
| 8 | +int main() { | |
| 9 | + sqlite3* database; | |
| 10 | + int exit = 0; | |
| 11 | + exit = sqlite3_open("example_database", &database); | |
| 12 | + | |
| 13 | + if (exit) { | |
| 14 | + std::cerr << "Error opening database" << sqlite3_errmsg(database) << std::endl; | |
| 15 | + return -1; | |
| 16 | + } | |
| 17 | + else { | |
| 18 | + std::cout << "Opened database successfully!" << std::endl; | |
| 19 | + } | |
| 20 | + sqlite3_close(database); | |
| 21 | + | |
| 22 | + | |
| 23 | + //system(gamePath); | |
| 24 | + return 0; | |
| 25 | +} | |
| \ No newline at end of file | ||
| new file mode 100644 | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | +#include <iostream> | ||
| 2 | +#include <string> | ||
| 3 | +#include <cstdlib> | ||
| 4 | +#include <../include/sqlite3.h> | ||
| 5 | + | ||
| 6 | +const char* gamePath = ""; | ||
| 7 | + | ||
| 8 | +int main() { | ||
| 9 | + sqlite3* database; | ||
| 10 | + int exit = 0; | ||
| 11 | + exit = sqlite3_open("example_database", &database); | ||
| 12 | + | ||
| 13 | + if (exit) { | ||
| 14 | + std::cerr << "Error opening database" << sqlite3_errmsg(database) << std::endl; | ||
| 15 | + return -1; | ||
| 16 | + } | ||
| 17 | + else { | ||
| 18 | + std::cout << "Opened database successfully!" << std::endl; | ||
| 19 | + } | ||
| 20 | + sqlite3_close(database); | ||
| 21 | + | ||
| 22 | + | ||
| 23 | + //system(gamePath); | ||
| 24 | + return 0; | ||
| 25 | +} | ||
| \ No newline at end of file | \ No newline at end of file | ||