| 221 | } |
| 222 | |
| 223 | void LogFile_Action(ZenLib::Ztring Inform) |
| 224 | { |
| 225 | if (LogFile_FileName.empty()) |
| 226 | return; |
| 227 | |
| 228 | std::string Inform_Ansi(Inform.To_UTF8()); |
| 229 | |
| 230 | #if defined(__cpp_lib_filesystem) && defined(__cpp_lib_char8_t) |
| 231 | std::string LogFile_FileName_u8(LogFile_FileName.To_UTF8()); |
| 232 | std::u8string LogFile_FileName_u8string(LogFile_FileName_u8.begin(), LogFile_FileName_u8.end()); |
| 233 | auto path = fs::path(LogFile_FileName_u8string); |
| 234 | #elif defined(__cpp_lib_filesystem) |
| 235 | auto path = fs::u8path(LogFile_FileName.To_UTF8()); |
| 236 | #else |
| 237 | auto path = LogFile_FileName.To_Local(); // May not have Unicode filepath support |
| 238 | #endif |
| 239 | std::ofstream File(path, std::ios_base::trunc); |
| 240 | |
| 241 | #if defined(_MSC_VER) && defined(UNICODE) |
| 242 | if (CLI_Option_Bom) |
| 243 | File.write("\xEF\xBB\xBF", 3); |
| 244 | #endif //defined(_MSC_VER) && defined(UNICODE) |
| 245 | File.write(Inform_Ansi.c_str(), Inform_Ansi.size()); |
| 246 | } |
| 247 | void CallBack_Set(Core &MI, void* Event_CallBackFunction) |
| 248 | { |
| 249 | //CallBack configuration |