From 04fd3aec8b5056736e6e47bddc401c0d468e7107 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Wed, 9 Aug 2023 21:48:30 -0400 Subject: [PATCH] static, nbt, cassert, algoritmn, get exposed Basically fix a bunch of stuff that came up in production --- .../.cmake/api/v1/query/cache-v2 | 0 .../.cmake/api/v1/query/cmakeFiles-v1 | 0 .../.cmake/api/v1/query/codemodel-v2 | 0 .../.cmake/api/v1/query/toolchains-v1 | 0 .../reply/cmakeFiles-v1-f35aa871f44e2fc7dd53.json | 0 ...ctory-.-RelWithDebInfo-f5ebdc15457944623624.json | 0 ...T_TESTS-RelWithDebInfo-cd26a691ed5f8a807cdc.json | 0 .../reply/toolchains-v1-34c4992596aa357843f9.json | 0 cmake-build-reldebug-asan/.ninja_deps | Bin cmake-build-reldebug-asan/.ninja_log | 0 cmake-build-reldebug-asan/CMakeCache.txt | 0 .../CMakeFiles/3.26.4/CMakeCCompiler.cmake | 0 .../CMakeFiles/3.26.4/CMakeCXXCompiler.cmake | 0 .../CMakeFiles/3.26.4/CMakeSystem.cmake | 0 .../3.26.4/CompilerIdC/CMakeCCompilerId.c | 0 .../3.26.4/CompilerIdCXX/CMakeCXXCompilerId.cpp | 0 .../CMakeFiles/BLT.dir/src/blt/nbt/nbt.cpp.o | Bin .../CMakeFiles/BLT.dir/src/blt/nbt/nbt_block.cpp.o | Bin .../CMakeFiles/BLT.dir/src/blt/parse/argparse.cpp.o | Bin .../BLT.dir/src/blt/profiling/profiler.cpp.o | Bin .../CMakeFiles/BLT.dir/src/blt/std/filesystem.cpp.o | Bin .../CMakeFiles/BLT.dir/src/blt/std/format.cpp.o | Bin .../CMakeFiles/BLT.dir/src/blt/std/loader.cpp.o | Bin .../CMakeFiles/BLT.dir/src/blt/std/logging.cpp.o | Bin .../CMakeFiles/BLT.dir/src/blt/std/string.cpp.o | Bin .../CMakeFiles/BLT.dir/src/blt/std/system.cpp.o | Bin .../CMakeFiles/BLT_TESTS.dir/src/tests/main.cpp.o | Bin .../CMakeFiles/CMakeConfigureLog.yaml | 0 .../CMakeFiles/TargetDirectories.txt | 0 .../CMakeFiles/clion-RelDebug ASAN-log.txt | 0 .../CMakeFiles/clion-environment.txt | Bin .../CMakeFiles/cmake.check_cache | 0 cmake-build-reldebug-asan/CMakeFiles/rules.ninja | 0 .../Testing/Temporary/LastTest.log | 0 cmake-build-reldebug-asan/build.ninja | 0 cmake-build-reldebug-asan/cmake_install.cmake | 0 cmake-build-reldebug-asan/libBLT.a | Bin cmake-build-reldebug-asan/super_file.nbt | Bin include/blt/parse/argparse.h | 3 +++ include/blt/std/string.h | 4 ++-- src/blt/nbt/nbt.cpp | 1 + src/blt/parse/argparse.cpp | 0 42 files changed, 6 insertions(+), 2 deletions(-) mode change 100644 => 100755 cmake-build-reldebug-asan/.cmake/api/v1/query/cache-v2 mode change 100644 => 100755 cmake-build-reldebug-asan/.cmake/api/v1/query/cmakeFiles-v1 mode change 100644 => 100755 cmake-build-reldebug-asan/.cmake/api/v1/query/codemodel-v2 mode change 100644 => 100755 cmake-build-reldebug-asan/.cmake/api/v1/query/toolchains-v1 mode change 100644 => 100755 cmake-build-reldebug-asan/.cmake/api/v1/reply/cmakeFiles-v1-f35aa871f44e2fc7dd53.json mode change 100644 => 100755 cmake-build-reldebug-asan/.cmake/api/v1/reply/directory-.-RelWithDebInfo-f5ebdc15457944623624.json mode change 100644 => 100755 cmake-build-reldebug-asan/.cmake/api/v1/reply/target-BLT_TESTS-RelWithDebInfo-cd26a691ed5f8a807cdc.json mode change 100644 => 100755 cmake-build-reldebug-asan/.cmake/api/v1/reply/toolchains-v1-34c4992596aa357843f9.json mode change 100644 => 100755 cmake-build-reldebug-asan/.ninja_deps mode change 100644 => 100755 cmake-build-reldebug-asan/.ninja_log mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeCache.txt mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/3.26.4/CMakeCCompiler.cmake mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/3.26.4/CMakeCXXCompiler.cmake mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/3.26.4/CMakeSystem.cmake mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/3.26.4/CompilerIdC/CMakeCCompilerId.c mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/3.26.4/CompilerIdCXX/CMakeCXXCompilerId.cpp mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/nbt/nbt.cpp.o mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/nbt/nbt_block.cpp.o mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/parse/argparse.cpp.o mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/filesystem.cpp.o mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/format.cpp.o mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/loader.cpp.o mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/logging.cpp.o mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/string.cpp.o mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/system.cpp.o mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/BLT_TESTS.dir/src/tests/main.cpp.o mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/CMakeConfigureLog.yaml mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/TargetDirectories.txt mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/clion-RelDebug ASAN-log.txt mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/clion-environment.txt mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/cmake.check_cache mode change 100644 => 100755 cmake-build-reldebug-asan/CMakeFiles/rules.ninja mode change 100644 => 100755 cmake-build-reldebug-asan/Testing/Temporary/LastTest.log mode change 100644 => 100755 cmake-build-reldebug-asan/build.ninja mode change 100644 => 100755 cmake-build-reldebug-asan/cmake_install.cmake mode change 100644 => 100755 cmake-build-reldebug-asan/libBLT.a mode change 100644 => 100755 cmake-build-reldebug-asan/super_file.nbt mode change 100644 => 100755 include/blt/parse/argparse.h mode change 100644 => 100755 src/blt/parse/argparse.cpp diff --git a/cmake-build-reldebug-asan/.cmake/api/v1/query/cache-v2 b/cmake-build-reldebug-asan/.cmake/api/v1/query/cache-v2 old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/.cmake/api/v1/query/cmakeFiles-v1 b/cmake-build-reldebug-asan/.cmake/api/v1/query/cmakeFiles-v1 old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/.cmake/api/v1/query/codemodel-v2 b/cmake-build-reldebug-asan/.cmake/api/v1/query/codemodel-v2 old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/.cmake/api/v1/query/toolchains-v1 b/cmake-build-reldebug-asan/.cmake/api/v1/query/toolchains-v1 old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/.cmake/api/v1/reply/cmakeFiles-v1-f35aa871f44e2fc7dd53.json b/cmake-build-reldebug-asan/.cmake/api/v1/reply/cmakeFiles-v1-f35aa871f44e2fc7dd53.json old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/.cmake/api/v1/reply/directory-.-RelWithDebInfo-f5ebdc15457944623624.json b/cmake-build-reldebug-asan/.cmake/api/v1/reply/directory-.-RelWithDebInfo-f5ebdc15457944623624.json old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/.cmake/api/v1/reply/target-BLT_TESTS-RelWithDebInfo-cd26a691ed5f8a807cdc.json b/cmake-build-reldebug-asan/.cmake/api/v1/reply/target-BLT_TESTS-RelWithDebInfo-cd26a691ed5f8a807cdc.json old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/.cmake/api/v1/reply/toolchains-v1-34c4992596aa357843f9.json b/cmake-build-reldebug-asan/.cmake/api/v1/reply/toolchains-v1-34c4992596aa357843f9.json old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/.ninja_deps b/cmake-build-reldebug-asan/.ninja_deps old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/.ninja_log b/cmake-build-reldebug-asan/.ninja_log old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeCache.txt b/cmake-build-reldebug-asan/CMakeCache.txt old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/3.26.4/CMakeCCompiler.cmake b/cmake-build-reldebug-asan/CMakeFiles/3.26.4/CMakeCCompiler.cmake old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/3.26.4/CMakeCXXCompiler.cmake b/cmake-build-reldebug-asan/CMakeFiles/3.26.4/CMakeCXXCompiler.cmake old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/3.26.4/CMakeSystem.cmake b/cmake-build-reldebug-asan/CMakeFiles/3.26.4/CMakeSystem.cmake old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/3.26.4/CompilerIdC/CMakeCCompilerId.c b/cmake-build-reldebug-asan/CMakeFiles/3.26.4/CompilerIdC/CMakeCCompilerId.c old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/3.26.4/CompilerIdCXX/CMakeCXXCompilerId.cpp b/cmake-build-reldebug-asan/CMakeFiles/3.26.4/CompilerIdCXX/CMakeCXXCompilerId.cpp old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/nbt/nbt.cpp.o b/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/nbt/nbt.cpp.o old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/nbt/nbt_block.cpp.o b/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/nbt/nbt_block.cpp.o old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/parse/argparse.cpp.o b/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/parse/argparse.cpp.o old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o b/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/profiling/profiler.cpp.o old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/filesystem.cpp.o b/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/filesystem.cpp.o old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/format.cpp.o b/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/format.cpp.o old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/loader.cpp.o b/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/loader.cpp.o old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/logging.cpp.o b/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/logging.cpp.o old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/string.cpp.o b/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/string.cpp.o old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/system.cpp.o b/cmake-build-reldebug-asan/CMakeFiles/BLT.dir/src/blt/std/system.cpp.o old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/BLT_TESTS.dir/src/tests/main.cpp.o b/cmake-build-reldebug-asan/CMakeFiles/BLT_TESTS.dir/src/tests/main.cpp.o old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/CMakeConfigureLog.yaml b/cmake-build-reldebug-asan/CMakeFiles/CMakeConfigureLog.yaml old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/TargetDirectories.txt b/cmake-build-reldebug-asan/CMakeFiles/TargetDirectories.txt old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/clion-RelDebug ASAN-log.txt b/cmake-build-reldebug-asan/CMakeFiles/clion-RelDebug ASAN-log.txt old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/clion-environment.txt b/cmake-build-reldebug-asan/CMakeFiles/clion-environment.txt old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/cmake.check_cache b/cmake-build-reldebug-asan/CMakeFiles/cmake.check_cache old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/CMakeFiles/rules.ninja b/cmake-build-reldebug-asan/CMakeFiles/rules.ninja old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/Testing/Temporary/LastTest.log b/cmake-build-reldebug-asan/Testing/Temporary/LastTest.log old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/build.ninja b/cmake-build-reldebug-asan/build.ninja old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/cmake_install.cmake b/cmake-build-reldebug-asan/cmake_install.cmake old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/libBLT.a b/cmake-build-reldebug-asan/libBLT.a old mode 100644 new mode 100755 diff --git a/cmake-build-reldebug-asan/super_file.nbt b/cmake-build-reldebug-asan/super_file.nbt old mode 100644 new mode 100755 diff --git a/include/blt/parse/argparse.h b/include/blt/parse/argparse.h old mode 100644 new mode 100755 index 73f30c3..5625d27 --- a/include/blt/parse/argparse.h +++ b/include/blt/parse/argparse.h @@ -14,6 +14,7 @@ #include #include #include +#include namespace blt { @@ -314,6 +315,8 @@ namespace blt void processFlag(arg_tokenizer& tokenizer, const std::string& flag); + public: + template static inline bool holds_alternative(const arg_data_t& v) { diff --git a/include/blt/std/string.h b/include/blt/std/string.h index 4f9d65a..97b5215 100755 --- a/include/blt/std/string.h +++ b/include/blt/std/string.h @@ -140,7 +140,7 @@ namespace blt::string { } // https://stackoverflow.com/questions/3418231/replace-part-of-a-string-with-another-string - bool replace(std::string& str, const std::string& from, const std::string& to) { + static bool replace(std::string& str, const std::string& from, const std::string& to) { size_t start_pos = str.find(from); if(start_pos == std::string::npos) return false; @@ -148,7 +148,7 @@ namespace blt::string { return true; } - void replaceAll(std::string& str, const std::string& from, const std::string& to) { + static void replaceAll(std::string& str, const std::string& from, const std::string& to) { if(from.empty()) return; size_t start_pos = 0; diff --git a/src/blt/nbt/nbt.cpp b/src/blt/nbt/nbt.cpp index 02dcba3..fb8d297 100755 --- a/src/blt/nbt/nbt.cpp +++ b/src/blt/nbt/nbt.cpp @@ -5,6 +5,7 @@ */ #include #include +#include #include diff --git a/src/blt/parse/argparse.cpp b/src/blt/parse/argparse.cpp old mode 100644 new mode 100755