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.
This commit is contained in:
2024-07-13 12:58:49 +08:00
parent ed549592dd
commit 1ccea1290e
5 changed files with 38 additions and 17 deletions

View File

@ -54,6 +54,8 @@
\li \subpage dialog_helper
\li \subpage win_fct_helper
\li \subpage exception_helper
</TD>

View File

@ -96,6 +96,24 @@ This macro will do this automatically.
In detail, this macro do a \c reinterpret_cast to change the type of given argument to \c const \c yycc_char8_t* forcely.
This ensure that declared UTF8 literal is compatible with YYCC UTF8 types.
\subsection library_encoding__utf8_literal__char Single Char
Same as UTF8 literal, YYCC allow you cast normal \c char into \c yycc_char8_t as following code:
\code
YYCC_U8_CHAR('A')
\endcode
YYCC_U8_CHAR is a macro.
It just simply use \c static_cast to cast given value to \c yycc_char8_t.
It doesn't mean that you can cast non-ASCII characters,
because the space these characters occupied usually more than the maximum value of \c char.
For example, following code is \b invalid:
\code
YYCC_U8_CHAR('文') // INVALID!
\endcode
\subsection library_encoding__utf8_literal__concatenation Literal Concatenation
YYCC_U8 macro also works for string literal concatenation:

View File

@ -0,0 +1,17 @@
/**
\page win_fct_helper Windows Function Helper
This helper give a more convenient way to call Windows functions.
This namespace is Windows specific.
It will be entirely invisible in other platforms.
Currently this namespace has following functions:
\li YYCC::WinFctHelper::GetCurrentModule: Get the handle to current module.
\li YYCC::WinFctHelper::GetTempDirectory: Get temporary directory in Windows.
\li YYCC::WinFctHelper::GetModuleFileName: Get the path to module in file system by given handle.
\li YYCC::WinFctHelper::GetLocalAppData: Get the path inside \%LOCALAPPDATA\%
*/