From 12a59859160b2e6a4400702930413f037e3668dc Mon Sep 17 00:00:00 2001 From: Brett Date: Sun, 29 Jan 2023 23:36:42 -0500 Subject: [PATCH] Push V0.3.2a --- CMakeLists.txt | 2 +- cmake-build-release/CMakeCache.txt | 4 ++-- .../CMakeFiles/clion-Release-log.txt | 2 +- include/blt/nbt/nbt.h | 22 +++++++++++++++++++ include/blt/std/filesystem.h | 1 + include/blt/std/format.h | 7 ------ include/blt/std/logging.h | 2 +- src/blt/std/format.cpp | 1 + src/blt/std/logging.cpp | 4 +++- 9 files changed, 32 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 023f6a9..887b7b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.24) -project(BLT VERSION 0.3.1) +project(BLT VERSION 0.3.2) set(CMAKE_CXX_STANDARD 17) diff --git a/cmake-build-release/CMakeCache.txt b/cmake-build-release/CMakeCache.txt index 10acdf5..4115ea1 100644 --- a/cmake-build-release/CMakeCache.txt +++ b/cmake-build-release/CMakeCache.txt @@ -181,7 +181,7 @@ CMAKE_PROJECT_HOMEPAGE_URL:STATIC= CMAKE_PROJECT_NAME:STATIC=BLT_TESTS //Value Computed by CMake -CMAKE_PROJECT_VERSION:STATIC=0.3.1 +CMAKE_PROJECT_VERSION:STATIC=0.3.2 //Value Computed by CMake CMAKE_PROJECT_VERSION_MAJOR:STATIC=0 @@ -190,7 +190,7 @@ CMAKE_PROJECT_VERSION_MAJOR:STATIC=0 CMAKE_PROJECT_VERSION_MINOR:STATIC=3 //Value Computed by CMake -CMAKE_PROJECT_VERSION_PATCH:STATIC=1 +CMAKE_PROJECT_VERSION_PATCH:STATIC=2 //Value Computed by CMake CMAKE_PROJECT_VERSION_TWEAK:STATIC= diff --git a/cmake-build-release/CMakeFiles/clion-Release-log.txt b/cmake-build-release/CMakeFiles/clion-Release-log.txt index 384f1a7..59fe53c 100644 --- a/cmake-build-release/CMakeFiles/clion-Release-log.txt +++ b/cmake-build-release/CMakeFiles/clion-Release-log.txt @@ -3,7 +3,7 @@ Standard Files /home/brett/Documents/code/c++/BLT/src/blt/std/filesystem.cpp;/ho Profiler Files /home/brett/Documents/code/c++/BLT/src/blt/profiling/profiler.cpp Source: /home/brett/Documents/code/c++/BLT Current Source: /home/brett/Documents/code/c++/BLT -BLT 0.3.1 Successfully included! +BLT 0.3.2 Successfully included! BLT tests included! -- Configuring done -- Generating done diff --git a/include/blt/nbt/nbt.h b/include/blt/nbt/nbt.h index 971ebc2..9ddbcf7 100644 --- a/include/blt/nbt/nbt.h +++ b/include/blt/nbt/nbt.h @@ -15,6 +15,28 @@ namespace blt::nbt { std::string readUTF8String(std::fstream& stream); + enum nbt_type { + tag_end = 0, + tag_byte = 1, + tag_short = 2, + tag_int = 3, + tag_long = 4, + tag_float = 5, + tag_double = 6, + tag_byte_array = 7, + tag_string = 8, + tag_list = 9, + tag_compound = 10, + tag_int_array = 11, + tag_long_array = 12 + }; + + class nbt_tag { + public: + virtual void readTag() = 0; + virtual void writeTag() = 0; + }; + class NBTDecoder { private: blt::fs::block_reader* m_reader; diff --git a/include/blt/std/filesystem.h b/include/blt/std/filesystem.h index 0cb0313..0d38d9b 100644 --- a/include/blt/std/filesystem.h +++ b/include/blt/std/filesystem.h @@ -52,6 +52,7 @@ namespace blt::fs { */ class block_reader { protected: + // 32768 block size seems the fastest on my system unsigned long m_bufferSize; public: explicit block_reader(unsigned long bufferSize): m_bufferSize(bufferSize) {} diff --git a/include/blt/std/format.h b/include/blt/std/format.h index e154db5..17e798c 100644 --- a/include/blt/std/format.h +++ b/include/blt/std/format.h @@ -220,12 +220,5 @@ namespace blt::string { std::vector createTable(bool top = false, bool bottom = false); }; - class LineGraphFormatter { - private: - - public: - - }; - } #endif //BLT_TESTS_FORMAT_H diff --git a/include/blt/std/logging.h b/include/blt/std/logging.h index b5046fc..a0b6dbf 100644 --- a/include/blt/std/logging.h +++ b/include/blt/std/logging.h @@ -19,7 +19,7 @@ namespace blt::logging { bool m_useColor = true; bool m_logToConsole = true; bool m_logToFile = true; - const char* m_directory = "./log/"; + const char* m_directory = "./"; LOG_LEVEL minLevel = TRACE; explicit constexpr LOG_PROPERTIES(bool useColor, bool logToConsole, bool logToFile, const char* directory): diff --git a/src/blt/std/format.cpp b/src/blt/std/format.cpp index 94d1c2b..a257c14 100644 --- a/src/blt/std/format.cpp +++ b/src/blt/std/format.cpp @@ -121,3 +121,4 @@ void blt::string::TableFormatter::updateMaxColumnLengths() { } } } + diff --git a/src/blt/std/logging.cpp b/src/blt/std/logging.cpp index 4a3b841..03dc970 100644 --- a/src/blt/std/logging.cpp +++ b/src/blt/std/logging.cpp @@ -13,6 +13,7 @@ #include #include #include +#include // https://en.cppreference.com/w/cpp/utility/variadic // https://medium.com/swlh/variadic-functions-3419c287a0d2 @@ -84,12 +85,13 @@ namespace blt::logging { }; // by default everything is enabled - LOG_PROPERTIES BLT_LOGGING_PROPERTIES{true, true, true, "./log/"}; + LOG_PROPERTIES BLT_LOGGING_PROPERTIES {}; LogFileWriter writer{"./"}; void init(LOG_PROPERTIES properties) { if (BLT_LOGGING_PROPERTIES.m_directory != properties.m_directory) writer = LogFileWriter{properties.m_directory}; + std::filesystem::create_directory(properties.m_directory); BLT_LOGGING_PROPERTIES = properties; }