doc: add callback documentation in ExceptionHelper.
- add callback documentation in ExceptionHelper. - fix other misc documentation issue.
This commit is contained in:
8
doc/src/arg_parser.dox
Normal file
8
doc/src/arg_parser.dox
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
|
||||
\page arg_parser Universal Argument Parser
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
@ -106,7 +106,7 @@ So please note the type of result is decided by convertion function itself, not
|
||||
According to the way providing source string,
|
||||
these 4 overload also can be divided into 2 types.
|
||||
The first type take a reference to constant \c std::wstring_view.
|
||||
The second type take a pointer to constant wchar_t.
|
||||
The second type take a pointer to constant \c wchar_t.
|
||||
|
||||
For first type, it will take the whole string for convertion, including \b embedded NUL terminal.
|
||||
Please note we use string view as argument.
|
||||
|
@ -18,11 +18,21 @@ It will be invisible on other platforms.
|
||||
|
||||
\subsection exception_helper__usage__code Register Code
|
||||
|
||||
In most scenarios, programmer only need call YYCC::ExceptionHelper::Register() when program started or module loaded.
|
||||
In most scenarios, programmer only need call YYCC::ExceptionHelper::Register when program started or module loaded.
|
||||
And call YYCC::ExceptionHelper::Unregister when program exited or module unloaded.
|
||||
All details are hidden by these 2 feature.
|
||||
Programmer do not need worried about the implementation of unhandled exception handler.
|
||||
|
||||
Optionally, you can provide a function pointer during calling YYCC::ExceptionHelper::Register as a callback.
|
||||
The prototype of this function pointer is YYCC::ExceptionHelper::ExceptionCallback.
|
||||
This callback will be called if any unhandled exception happened.
|
||||
It provides 2 pathes to log file and core dump file respectively.
|
||||
So that you can use an explicit way, e.g. \c MessageBox, to tell user exception happened and where are the log files,
|
||||
especially in GUI application because the default output stream, \c stderr, is invisible in GUI application.
|
||||
|
||||
However, please note the pathes provided by callback may be empty.
|
||||
In this case, it means that handler fail to create corresponding log files.
|
||||
|
||||
\subsection exception_helper__usage__location Location
|
||||
|
||||
When unhandled exception occurs,
|
||||
@ -84,4 +94,12 @@ YYCC::ExceptionHelper has internal mechanism to prevent this bad case.
|
||||
If this really happened, the handler will quit silent and will not cause any issue.
|
||||
Programmer don't need to worry about this.
|
||||
|
||||
\subsection exception_helper__notes__user_callback The Timing of User Callback
|
||||
|
||||
The timing of calling user callback is the tail of unhandled exception handler.
|
||||
It means that all log and coredump have been written if possible before calling callback.
|
||||
Because user callback may still raise exception.
|
||||
We want all essential log files has been written before calling it,
|
||||
so that at least we can visit them on disk or console.
|
||||
|
||||
*/
|
||||
|
@ -49,6 +49,8 @@
|
||||
|
||||
\li \subpage config_manager
|
||||
|
||||
\li \subpage arg_parser
|
||||
|
||||
</TD>
|
||||
<TD ALIGN="LEFT" VALIGN="TOP">
|
||||
|
||||
|
Reference in New Issue
Block a user