Reorganize file structure again. Fix confusing issue dealing with null terminators with static_string using an array for initialization
This commit is contained in:
parent
ed1c6dd211
commit
7351e3be10
@ -5,8 +5,8 @@ project(librexy)
|
||||
set(librexy_VERSION_MAJOR 0)
|
||||
set(librexy_VERSION_MINOR 1)
|
||||
set(librexy_VERSION_REVISION 0)
|
||||
set(INCLUDE_PATH ${CMAKE_SOURCE_DIR})
|
||||
include_directories("${INCLUDE_PATH}")
|
||||
set(INCLUDE_PATH ${CMAKE_SOURCE_DIR}/include)
|
||||
include_directories(BEFORE SYSTEM "${INCLUDE_PATH}")
|
||||
|
||||
set(LIBREXY_LIBFLAGS "-lrexy")
|
||||
|
||||
@ -14,7 +14,7 @@ option(ENABLE_SHARED "Build shared library" ON)
|
||||
option(ENABLE_PROFILING "Enable asan" OFF)
|
||||
mark_as_advanced(ENABLE_PROFILING)
|
||||
|
||||
set(SOURCE_LIST "rexy/src/binary.cpp" "rexy/src/string_base.cpp" "rexy/src/filerd.cpp")
|
||||
set(SOURCE_LIST "src/binary.cpp" "src/string_base.cpp" "src/filerd.cpp")
|
||||
if(ENABLE_SHARED)
|
||||
add_library(rexy SHARED ${SOURCE_LIST})
|
||||
set_target_properties(rexy PROPERTIES SOVERSION "${librexy_VERSION_MAJOR}.${librexy_VERSION_MINOR}.${librexy_VERSION_REVISION}")
|
||||
@ -27,7 +27,7 @@ if(ENABLE_PROFILING)
|
||||
target_link_options(rexy PRIVATE -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls)
|
||||
endif()
|
||||
|
||||
set(LIBREXY_PUBLIC_HEADERS "rexy/include/binary.hpp" "rexy/include/string_base.hpp" "rexy/include/string.hpp" "rexy/include/filerd.hpp" "rexy/include/string_base.tpp" "rexy/include/detail/binary_string_conv.hpp" "rexy/include/detail/default_allocator.hpp" "rexy/include/detail/util.hpp")
|
||||
set(LIBREXY_PUBLIC_HEADERS "include/rexy/binary.hpp" "include/rexy/string_base.hpp" "include/rexy/string.hpp" "include/rexy/filerd.hpp" "include/rexy/string_base.tpp" "include/rexy/detail/binary_string_conv.hpp" "include/rexy/detail/default_allocator.hpp" "include/rexy/detail/util.hpp")
|
||||
target_compile_options(rexy PRIVATE -Wall -Wextra -pedantic -std=c++17)
|
||||
|
||||
install(TARGETS rexy
|
||||
|
||||
@ -137,8 +137,6 @@ namespace rexy{
|
||||
{
|
||||
public:
|
||||
constexpr static_string(void) = default;
|
||||
template<size_t N>
|
||||
constexpr static_string(const char(&str)[N]);
|
||||
constexpr static_string(const char* str, size_t len);
|
||||
static_string(const char* c);
|
||||
constexpr static_string(const static_string& s);
|
||||
@ -218,9 +218,6 @@ namespace rexy{
|
||||
}
|
||||
|
||||
|
||||
template<size_t N>
|
||||
constexpr static_string::static_string(const char(&str)[N]):
|
||||
string_base(const_cast<char*>(str), N, N){}
|
||||
constexpr static_string::static_string(const char* str, size_t len):
|
||||
string_base(const_cast<char*>(str), len, len){}
|
||||
constexpr static_string::static_string(const static_string& s):
|
||||
@ -16,7 +16,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "rexy/include/binary.hpp"
|
||||
#include "rexy/binary.hpp"
|
||||
|
||||
namespace rexy{
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "rexy/include/filerd.hpp"
|
||||
#include "rexy/filerd.hpp"
|
||||
|
||||
#include <cstdio> //fopen, fclose
|
||||
#include <utility> //exchange, swap
|
||||
@ -16,7 +16,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "rexy/include/string_base.hpp"
|
||||
#include "rexy/string_base.hpp"
|
||||
|
||||
#include <utility> //exchange, swap
|
||||
#include <cstdlib> //memcpy
|
||||
Loading…
x
Reference in New Issue
Block a user