9 Commits
1.1.0 ... 1.1.3

Author SHA1 Message Date
7da2e27d22 Set ninja as generator
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-02-12 13:19:26 +01:00
3df014f332 Merge remote-tracking branch 'origin/master'
Some checks failed
continuous-integration/drone/push Build is failing
2022-02-12 13:15:22 +01:00
0d627d3e7b Fixes CI 2022-02-12 13:12:43 +01:00
003e33c05a If key is "key" and value is "value" ignore the line.
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build is failing
2021-11-12 12:20:53 +01:00
5311df51ad Link exe statically.
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2021-09-07 18:47:51 +02:00
f95ee90a20 Merge remote-tracking branch 'origin/master'
All checks were successful
continuous-integration/drone Build is passing
2021-09-07 18:39:06 +02:00
d7beb77f1d Better handling of detecting csv separator. 2021-09-07 18:38:19 +02:00
14a8709631 Merge branch 'master' of ssh.p-epsilon.com:Deukhoofd/LangBuilder
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-29 11:35:16 +02:00
f2a4352f44 Remove old api token 2021-08-29 11:35:02 +02:00
3 changed files with 26 additions and 11 deletions

View File

@@ -9,21 +9,27 @@ steps:
CC: /usr/bin/clang CC: /usr/bin/clang
CXX: /usr/bin/clang++ CXX: /usr/bin/clang++
commands: commands:
- cmake -DCMAKE_BUILD_TYPE=Release . -B build-release - cmake -GNinja -DCMAKE_BUILD_TYPE=Release . -B build-release
- cmake --build build-release --target all -- -j 4 - cmake --build build-release --target all -- -j 4
- name: build-release-windows - name: build-release-windows
image: deukhoofd/windowsbuilder image: deukhoofd/windowsbuilder
environment:
CHOST: x86_64-w64-mingw32
AR: x86_64-w64-mingw32-ar
AS: x86_64-w64-mingw32-as
RANLIB: x86_64-w64-mingw32-ranlib
CC: x86_64-w64-mingw32-gcc
CXX: x86_64-w64-mingw32-g++
STRIP: x86_64-w64-mingw32-strip
RC: x86_64-w64-mingw32-windres
commands: commands:
- update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix - cmake -GNinja -DCMAKE_BUILD_TYPE=Release . -B build-release-windows -D CMAKE_C_COMPILER=/usr/bin/x86_64-w64-mingw32-gcc -D CMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++
- update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
- update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
- update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
- cmake -DCMAKE_BUILD_TYPE=Release . -B build-release-windows -D CMAKE_C_COMPILER=/usr/bin/x86_64-w64-mingw32-gcc -D CMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++
- cmake --build build-release-windows --target all -- -j 4 - cmake --build build-release-windows --target all -- -j 4
- 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

View File

@@ -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)

View File

@@ -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;
@@ -43,6 +49,8 @@ void LocalizationFile::LoadFile(const std::filesystem::path& path) {
std::getline(linestream, value, sep); std::getline(linestream, value, sep);
if (key.empty()) if (key.empty())
continue; continue;
if (key == "key" && value == "value")
continue;
if (!IsKeyValid(key)){ if (!IsKeyValid(key)){
std::cout << "Key not valid: '" << key << "'. Skipping key." << std::endl; std::cout << "Key not valid: '" << key << "'. Skipping key." << std::endl;
} }