feat: basically finish parser helper.

- basically finish parser helper, including TryParse, Parse and ToString.
- only Parse has been tested. other test should be filled in future.
This commit is contained in:
2024-05-28 19:59:41 +08:00
parent d437ecc140
commit 72eb79ce1a
9 changed files with 141 additions and 17 deletions

View File

@ -5,8 +5,18 @@
#include <cstdio>
namespace YYCC::IOHelper {
/**
* @brief Set given FILE* as UTF8 mode.
* @param fs[in] The FILE* need to be set as UTF8 mode.
* @return True if success, otherwise false.
* @warning Once this function success, you can not use any narrow char function on this FILE*,
* such as std::fputs, std::fprintf and etc. You only can use wide char function on it,
* or use the functions provided in this namespace by providing UTF8 string as their argument.
*/
bool futf8(FILE* fs);
FILE* FOpen(const char* u8_filepath, const char* u8_mode);
FILE* fopen(const char* u8_filepath, const char* u8_mode);
}