From 650af9877f79a6646ddb40e989f78bd122d6383a Mon Sep 17 00:00:00 2001 From: Brett Date: Thu, 31 Aug 2023 21:47:32 -0400 Subject: [PATCH] inline some string functions - disable warnings --- include/blt/std/filesystem.h | 4 ++-- include/blt/std/logging.h | 2 +- include/blt/std/string.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/blt/std/filesystem.h b/include/blt/std/filesystem.h index 01221f3..2c1d049 100755 --- a/include/blt/std/filesystem.h +++ b/include/blt/std/filesystem.h @@ -38,7 +38,7 @@ namespace blt::fs */ virtual int read(char* buffer, size_t bytes) = 0; - virtual int gcount() = 0; + virtual size_t gcount() = 0; virtual char get() { @@ -102,7 +102,7 @@ namespace blt::fs int read(char* buffer, size_t bytes) override; - int gcount() final { + size_t gcount() final { return m_stream.gcount(); } diff --git a/include/blt/std/logging.h b/include/blt/std/logging.h index 884c825..5694527 100755 --- a/include/blt/std/logging.h +++ b/include/blt/std/logging.h @@ -454,7 +454,7 @@ namespace blt::logging { } /** - * Checks if the next character in the parser is a tag opening, if not output the chars to the out string + * Checks if the next character in the parser is a tag opening, if not output the buffer to the out string */ inline bool tagOpening(string_parser& parser, std::string& out){ char c = ' '; diff --git a/include/blt/std/string.h b/include/blt/std/string.h index 97b5215..b8ad975 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 - static bool replace(std::string& str, const std::string& from, const std::string& to) { + static inline 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; } - static void replaceAll(std::string& str, const std::string& from, const std::string& to) { + static inline void replaceAll(std::string& str, const std::string& from, const std::string& to) { if(from.empty()) return; size_t start_pos = 0;