1
0

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.
This commit is contained in:
2024-07-31 14:14:38 +08:00
parent 598aae69ae
commit 1cfbcb3b18
15 changed files with 142 additions and 97 deletions

View File

@@ -1,3 +1,4 @@
namespace YYCC::ParserHelper {
/**
\page parser_helper Parser Helper
@@ -18,7 +19,7 @@ For \c bool type, parser will try doing convertion between it and \c "true" \c "
\section parser_helper__try_parse Try Parse
YYCC::ParserHelper::TryParse will try to parse string into caller specified type.
#TryParse will try to parse string into caller specified type.
All of them accept an UTF8 string view at first argument,
require that you provide a container receiving converted result in the second argument,
and return a bool value to indicate whether the convertion is successful.
@@ -34,7 +35,7 @@ For integral type, this function allows caller to specify extra argument providi
\section parser_helper__parse Parse
YYCC::ParserHelper::Parse is similar to YYCC::ParserHelper::TryParse.
#Parse is similar to #TryParse.
But it will not return bool value to indicate success and doesn't have the argument receiving result.
It only accepts an UTF8 string view as the only one argument, and return result directly.
If the convertion failed, the return value is \b undefined (but usually is the default value of given type).
@@ -44,15 +45,15 @@ There is an example:
uint32_t val = YYCC::ParserHelper::Parse<uint32_t>(YYCC_U8("123"));
\endcode
Please note, for integral types, there is no base argument in YYCC::ParserHelper::Parse.
Please use YYCC::ParserHelper::TryParse instead.
Please note, for integral types, there is no base argument in #Parse.
Please use #TryParse instead.
Using this function is dangerous if the validation of your input is important.
In this case, please use YYCC::ParserHelper::TryParse instead.
In this case, please use #TryParse instead.
\section parser_helper__to_string To String
YYCC::ParserHelper::ToString basically is the reversed operation of YYCC::ParserHelper::Parse.
#ToString basically is the reversed operation of #Parse.
It gets the string representation of given type.
The only argument of these functions is the type which need to be converted to its string representation.
And they will return yycc_u8string as result.
@@ -77,4 +78,5 @@ The argument of template is the type these functions need to be processed.
Although C++ have \e smart template type deduction,
it would be better to specify template argument manually to explicitly specify your desired type.
*/
*/
}