diff options
author | George L. Albany <Megacake1234@gmail.com> | 2023-09-02 14:31:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-02 14:31:44 +0200 |
commit | f990117e56060811ddd2a850ec712485aea79649 (patch) | |
tree | 2bb062c320fa2227b18956617b94d0e8800420d8 /src/openvic-dataloader/detail/Warnings.hpp | |
parent | e941573f47fb867ff75c8a2cf78302b754ffbeee (diff) | |
parent | 7440a5d1433eec4bf87e3723022db187e7f61b1a (diff) |
Merge pull request #7 from OpenVicProject/dataloading-event-and-functions
Diffstat (limited to 'src/openvic-dataloader/detail/Warnings.hpp')
-rw-r--r-- | src/openvic-dataloader/detail/Warnings.hpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/openvic-dataloader/detail/Warnings.hpp b/src/openvic-dataloader/detail/Warnings.hpp new file mode 100644 index 0000000..fc0fbed --- /dev/null +++ b/src/openvic-dataloader/detail/Warnings.hpp @@ -0,0 +1,21 @@ +#pragma once + +#include "openvic-dataloader/v2script/Parser.hpp" + +namespace ovdl::v2script::warnings { + inline const ParseWarning make_utf8_warning(const char* file_path) { + constexpr std::string_view message_suffix = "This may cause problems. Prefer Windows-1252 encoding."; + + std::string message; + if (!file_path) { + message = "Buffer is a UTF-8 encoded string. " + std::string(message_suffix); + } else { + message = "File '" + std::string(file_path) + "' is a UTF-8 encoded file. " + std::string(message_suffix); + } + + return ParseWarning { message, 1 }; + } +} + +namespace ovdl::ovscript::warnings { +}
\ No newline at end of file |