Commit Graph

74 Commits

Author SHA1 Message Date
72a48b703f feat: add various functions
- Add Win32 CopyFile, MoveFile, DeleteFile functions in WinFctHelper.
- rename FsPathPatch to StdPatch because this namespace will hold all standard library patches in future.
- add polyfill for std:basic_string::starts_with, std::basic_string::ends_with std::basic_string_view::starts_with, std::basic_string_view::ends_with in StdPatch.
- add polyfill for unordered and ordered associative standard library container's contains function in StdPatch.
- documentation and testbench will be fixed in later commits.
2024-08-13 09:38:12 +08:00
e6c24b8b61 feat: add helper macro and new Win32 function.
- add IsValidCodePage in WinFctHelper to check whether code page number is valid.
- add 6 macros to batchly (add / set default) (move / copy) (constructor / assign operator).
- add default or delete (copy / move) (constructor / assign operator) for some classes.
2024-08-04 11:57:56 +08:00
6da990876e feat: add smart FILE pointer.
- use std::unique_ptr and custom deleter to implement smart FILE pointer for convenient auto free.
2024-08-02 09:50:15 +08:00
0ac6b477f9 fix: fix fatal error of ExceptionHelper in x86 environemnt.
- fix a wrong placeholder of printf in ExceptionHelper which cause crash in unhandled exception handler.
- improve format function in ExceptionHelper.
- add a new debugging option and macro in CMake script and code for the convenience of debugging unhandled exception handler.
- add docuementation about previous term.
2024-07-31 20:32:11 +08:00
1cfbcb3b18 doc: update documentation
- use namespace bracket all content in documentation to reduce useless namespace prefix.
- change the argument type of AbstractSetting and CoreManager to yycc_u8string_view instead of const yycc_char8_t*.
- throw exception if given setting name is invalid in ConfigManager, instead of slient fallback.
2024-07-31 14:14:38 +08:00
598aae69ae doc: update documentation 2024-07-31 12:08:30 +08:00
656495f22e doc: update documentation 2024-07-30 22:13:59 +08:00
e167479de3 doc: add documentation for new added features 2024-07-30 17:31:38 +08:00
19023cb949 doc: add callback documentation in ExceptionHelper.
- add callback documentation in ExceptionHelper.
- fix other misc documentation issue.
2024-07-30 10:35:41 +08:00
650fcd12ec feat: add callback for unhandled exception handler.
- add callback for unhandled exception handler to give programmer a chance to fetch log and coredump path, especially for GUI application because its stderr is invisible.
- fix fatal anto-recursive calling bug in unhandled exception handler.
2024-07-29 21:42:27 +08:00
e8a0299fbc feat: finish ArgParser help text output 2024-07-29 19:31:17 +08:00
d1c1743dc9 feat: basically finish ArgParser
- finish ArgParser and test it.
- Help output function will be added in next commit.
2024-07-29 16:58:52 +08:00
35318505e4 feat: add arg parser feature but not finished 2024-07-28 22:42:16 +08:00
f997990af6 doc: finish all documentations 2024-07-26 15:08:12 +08:00
7f373ed354 doc: update documentation in code 2024-07-25 18:15:39 +08:00
31a7cb5675 doc: update documentation in code 2024-07-25 11:22:50 +08:00
87fa30fe82 doc: update documentation in code 2024-07-24 15:03:31 +08:00
805ffe70d6 fix: fix linux build issue
- fix linux build bug
- add linux build script
- order linux shell file eol be LF.
2024-07-22 22:41:10 +08:00
052fa7f4d1 chore: update build script.
- update CMake build script to make install statement is more legal.
- add Windows-only build script for creating CMake used package and MSVC used package on Windows.
- documentation will be added in the next commit.
2024-07-22 13:56:00 +08:00
94386c93aa doc: finish documentation of StringHelper 2024-07-17 14:18:54 +08:00
b13bb445e4 doc: add documentation for ConsoleHelper 2024-07-16 10:41:09 +08:00
81fe72c425 chore: add Natvis in MSVC CMake build.
- add Natvis in MSVC CMake build to let me can see the data encoded with YYCC::yycc_char8_t.
2024-07-15 22:47:49 +08:00
b912be082c doc: add documentation for COMHelper 2024-07-15 13:47:14 +08:00
1ccea1290e doc: add documentation for win fct helper
- add documentation for win fct helper
- add new macro YYCC_U8_CHAR for casting ordinary char to yycc utf8 char.
- add documentation for new added YYCC_U8_CHAR.
2024-07-13 12:58:49 +08:00
1c2007928d doc: update documentation for IO helper.
- update IO helper ducumentation.
- fix a latent Linux compile error in IO helper.
2024-07-11 09:59:50 +08:00
942e4ff8eb feat: add convertion functions between utf8 and code page string 2024-07-09 21:02:26 +08:00
d27a66e770 fix: fix ConfigManager::StringSetting issues
- use yycc_u8string_view in default value and Set function instead of const yycc_char8_t*
- fix value check error in Set function.
2024-07-07 21:33:42 +08:00
4f1e2447d0 fix: make exception handler be singleton in same process.
- use CreateMutexW to make sure exception handler is singleton in the same process.
	- Because one process may load multiple DLLs using YYCC.
	- According to this, it will produce N times error log. N is the count of DLLs using YYCC exception handler.
- refactor exception handler. use a class instance to manage all global variables and add a std::mutex to let module be thread safe.
- change the way of check in console input testbench.
2024-07-07 17:29:26 +08:00
3075ec583d fix: in config manager throw exception when facing duplicated setting name instead of slient skip 2024-07-07 16:08:42 +08:00
a1699f13db doc: update documentation
- rename Constrain to Constraint in code and documentation.
- remove massive annotation of encoding helper because the documentation is enough.
- fix doxygen character shift warnings.
2024-07-05 22:25:14 +08:00
65b81f5cfa refactor: rename Native String to Ordinary String.
- rename Native to Ordinary in code and documentation.
- fulfill some documentations.
2024-07-05 10:36:24 +08:00
e374575852 fix: fix issue in config manager.
- fix fwrite fread issue in config manager.
- add testbench for config manager.
- change testbench order to get better experience.
2024-07-03 10:14:17 +08:00
588946583c feat: add universal config manager implementation. 2024-07-02 10:52:24 +08:00
e1823d4b8e feat: add new split function reducing memory cost.
- add a new split function, SplitView which can reduce cost memory by using string view.
- add a new testbench for split function for testing empty source string.
- add documentation for some string helper function.
- improve library encoding documentation.
2024-06-29 17:39:13 +08:00
23b4da95ce fix: fix bug caused by refactor 2024-06-28 16:30:21 +08:00
e5b6e8c6c3 refactor: refactor testbench for UTF8 string. fix refactor bug 2024-06-28 16:24:27 +08:00
ccb729c718 refactor: update all modules for UTF8 string. waiting for debugging 2024-06-28 15:46:58 +08:00
44dbbb1c99 refactor: refactor string helper for UTF8 string 2024-06-28 14:44:39 +08:00
61ad1ff3ce refactor: refactor encoding helper again.
- add the convertion between yycc_char8_t and system char type because we decide use our char8_t in the whole library.
- make a clear boundary between yycc char8_t declarations and related assist functions. the declarations present in internal header and assist functions are written in encoding helper.
- use std::basic_string_view instead of std::basic_string to provide more abilities to encoding convertion functions and reduce the redundant memory occupation at the same time.
2024-06-27 20:49:02 +08:00
c15b57d055 refactor: bring char8_t to this library.
- add yycc_char8_t and yycc_u8string in code to indicate explicit utf8 char type and string. it also has a polyfill if compiler and library do not support utf8 char type.
- refactor the whole encoding helper. allow converting string with embedded NUL. but not tested.
2024-06-26 21:04:56 +08:00
bb17bb6a1f chore: update build system
- use configuration-arch-based path in MSVC to make sure generated package can be used by native MSVC project.
- add github action and corresponding build script. but not tested.
- fix some testbench code.
2024-06-20 15:51:40 +08:00
3fa05b43d9 fix: use new method to do the convertion among UTF8, UTF16 and UTF32.
- use std::codevct as the convertion method among UTF8, UTF16 and UTF32.
- fix the issue that COM Guard was accidently dropped by compiler because no reference to it.
2024-06-20 10:16:13 +08:00
1fd132f0c9 fix: fix build error in Linux environment.
- fix various build error in Linux environment.
- the convertion between UTF8, UTF16 and UTF32 have error in Linux and will be fixed in future.
2024-06-19 13:28:51 +08:00
f153f9bc22 doc: update comments of code.
- add lost testbench for wchar encoding convertion.
- update code documentation.
2024-06-18 16:03:41 +08:00
77b6f439f7 feat: add encoding convertion functions between utf8 and utf16, utf32.
- add bidirectional convertion between utf8 and utf16, utf32 in every platforms.
- add testbench for new added functions.
2024-06-18 11:03:48 +08:00
0319be7e19 feat: finish exception helper.
- finish exception helper.
	- switch to LOCALAPPDATA/CrashDumps as output directory.
- add testbench for exception helper.
- add lost testbench for GetLocalAppData in WinFctHelper.
- link with DbgHelp.lib on Windows in CMake.
2024-06-17 15:10:45 +08:00
e20c03a5f1 refactor: move COM type and guard into independent file
- move COM types and guard into independent file and namespace COMHelper because not only dialog, but also other parts also need to use COM related fucntion.
- remove ParserHelper.cpp because it is empty (ParserHelper is header only namespace).
- Add a function fetching LOCALAPPDATA in WinFctHelper.
2024-06-17 12:46:32 +08:00
8465d80a54 chore: update CMakeLists
- update the use of target_sources() to remove duplicated header file declarations.
	- thx Gary Wang
2024-06-15 22:03:17 +08:00
5481898ad9 feat: move std::filesystem::path related function to independent namespace.
- create FsPathPatch namespace to hold std::filesystem::path related functions.
- add corresponding testbench code for it.
2024-06-15 17:57:33 +08:00
e7b13768ec fix: rename function. update console function
- Update implementation of EnsureColorfulConsole.
	- previous implementation will exit if one of the process to stdout and stderr failed. so if it exit at the process of stdout, the process of stderr will not be run.
	- current implementation will always do process for both of stdout and stderr. the return value will be false if any process of them are failed.
- rename GetModuleName to GetModuleFileName and disable annoy Windows macro GetModuleFileName in WinImportSuffix.hpp.
2024-06-15 16:59:54 +08:00