Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
5311df51ad
|
|||
|
f95ee90a20
|
|||
|
d7beb77f1d
|
|||
|
14a8709631
|
|||
|
f2a4352f44
|
@@ -23,7 +23,8 @@ steps:
|
|||||||
- name: gitea_release
|
- name: gitea_release
|
||||||
image: plugins/gitea-release
|
image: plugins/gitea-release
|
||||||
settings:
|
settings:
|
||||||
api_key: 684b59c5281894a312cfb5f7c158a7720791eff1
|
api_key:
|
||||||
|
from_secret: gitea_token
|
||||||
base_url: https://git.p-epsilon.com/
|
base_url: https://git.p-epsilon.com/
|
||||||
files:
|
files:
|
||||||
- build-release/LangBuilder
|
- build-release/LangBuilder
|
||||||
|
|||||||
@@ -5,8 +5,9 @@ project(LangBuilder)
|
|||||||
add_compile_options(-Wall -Wextra -Werror)
|
add_compile_options(-Wall -Wextra -Werror)
|
||||||
# We like new stuff, so set the c++ standard to c++20.
|
# We like new stuff, so set the c++ standard to c++20.
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
set(BUILD_SHARED_LIBS OFF)
|
||||||
|
|
||||||
file(GLOB_RECURSE SRC_FILES "src/*.cpp" "src/*.hpp")
|
file(GLOB_RECURSE SRC_FILES "src/*.cpp" "src/*.hpp")
|
||||||
|
|
||||||
add_executable(LangBuilder ${SRC_FILES})
|
add_executable(LangBuilder ${SRC_FILES})
|
||||||
target_link_libraries(LangBuilder -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread)
|
target_link_libraries(LangBuilder -static -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread)
|
||||||
@@ -12,6 +12,10 @@ static bool IsKeyValid(const std::string_view & key){
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char PossibleSeparators[] = {
|
||||||
|
',', ';', '|', '\t', ':'
|
||||||
|
};
|
||||||
|
|
||||||
void LocalizationFile::LoadFile(const std::filesystem::path& path) {
|
void LocalizationFile::LoadFile(const std::filesystem::path& path) {
|
||||||
if (!std::filesystem::exists(path)) {
|
if (!std::filesystem::exists(path)) {
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
@@ -31,9 +35,11 @@ void LocalizationFile::LoadFile(const std::filesystem::path& path) {
|
|||||||
while (std::getline(file, line)) {
|
while (std::getline(file, line)) {
|
||||||
if (firstLine) {
|
if (firstLine) {
|
||||||
firstLine = false;
|
firstLine = false;
|
||||||
if (line.substr(0, 4) == "sep=") {
|
for (auto& s :PossibleSeparators) {
|
||||||
sep = line[4];
|
if (line.find(s) != std::string::npos){
|
||||||
continue;
|
sep = s;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::string key;
|
std::string key;
|
||||||
|
|||||||
Reference in New Issue
Block a user