Start adding config reader
This commit is contained in:
parent
6ff9370c4e
commit
cbc9ba77d2
14 changed files with 245 additions and 143 deletions
|
@ -9,7 +9,9 @@ list(APPEND core_HEADERS
|
|||
file_utilities/File.h
|
||||
file_utilities/FileFormats.h
|
||||
StringUtils.h
|
||||
http/HttpResponse.h)
|
||||
http/HttpResponse.h
|
||||
serializers/TomlReader.h
|
||||
)
|
||||
|
||||
list(APPEND core_LIB_INCLUDES
|
||||
Event.cpp
|
||||
|
@ -27,7 +29,8 @@ list(APPEND core_LIB_INCLUDES
|
|||
streams/BinaryStream.cpp
|
||||
http/HttpResponse.cpp
|
||||
http/HttpHeader.cpp
|
||||
http/HttpRequest.cpp)
|
||||
http/HttpRequest.cpp
|
||||
serializers/TomlReader.cpp)
|
||||
|
||||
# add the executable
|
||||
add_library(core SHARED ${core_LIB_INCLUDES} ${core_HEADERS})
|
||||
|
@ -39,6 +42,7 @@ target_include_directories(core PUBLIC
|
|||
"${CMAKE_CURRENT_SOURCE_DIR}/memory"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/streams"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/data_structures"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/serializers"
|
||||
)
|
||||
set_target_properties( core PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON )
|
||||
set_property(TARGET core PROPERTY FOLDER src)
|
|
@ -100,9 +100,9 @@ std::vector<std::string> File::readLines()
|
|||
return content;
|
||||
}
|
||||
|
||||
std::string File::getBaseFilename(const std::string& path)
|
||||
std::string File::getBaseFilename(const Path& path)
|
||||
{
|
||||
return std::filesystem::path(path).stem();
|
||||
return path.stem().string();
|
||||
}
|
||||
|
||||
std::string File::ReadText()
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
using Path = std::filesystem::path;
|
||||
|
||||
class File
|
||||
{
|
||||
public:
|
||||
|
@ -34,7 +36,7 @@ public:
|
|||
|
||||
std::vector<std::string> readLines();
|
||||
|
||||
static std::string getBaseFilename(const std::string& path);
|
||||
static std::string getBaseFilename(const Path& path);
|
||||
|
||||
bool PathExists() const;
|
||||
|
||||
|
|
0
src/core/serializers/TomlReader.cpp
Normal file
0
src/core/serializers/TomlReader.cpp
Normal file
16
src/core/serializers/TomlReader.h
Normal file
16
src/core/serializers/TomlReader.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#pragma once
|
||||
|
||||
#include <filesystem>;
|
||||
#include <unordered_map>
|
||||
|
||||
using Path = std::filesystem::path;
|
||||
|
||||
class TomlContent
|
||||
{
|
||||
//using SectionContent
|
||||
};
|
||||
|
||||
class TomlReader
|
||||
{
|
||||
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue