Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
c14c5ff2
Commit
c14c5ff2
authored
Jun 27, 2014
by
Milo Yip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation on error related files and include dependent header.
parent
69ca7487
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
7 deletions
+35
-7
en.h
include/rapidjson/error/en.h
+7
-0
error.h
include/rapidjson/error/error.h
+28
-7
No files found.
include/rapidjson/error/en.h
View file @
c14c5ff2
...
...
@@ -5,6 +5,13 @@
namespace
rapidjson
{
//! Maps error code of parsing into error message.
/*!
\param parseErrorCode Error code obtained in parsing.
\return the error message.
\note User can make a copy of this function for localization.
Using switch-case is safer for future modification of error codes.
*/
inline
const
RAPIDJSON_ERROR_CHARTYPE
*
GetParseError_En
(
ParseErrorCode
parseErrorCode
)
{
switch
(
parseErrorCode
)
{
case
kParseErrorNone
:
return
RAPIDJSON_ERROR_STRING
(
"No error."
);
...
...
include/rapidjson/error/error.h
View file @
c14c5ff2
#ifndef RAPIDJSON_ERROR_ERROR_H__
#define RAPIDJSON_ERROR_ERROR_H__
// For example, on Windows, user can define this macro as TCHAR
#include "../reader.h" // ParseErrorCode
///////////////////////////////////////////////////////////////////////////////
// RAPIDJSON_ERROR_CHARTYPE
//! Character type of error messages.
/*! The default charater type is char.
On Windows, user can define this macro as TCHAR for supporting both
unicode/non-unicode settings.
*/
#ifndef RAPIDJSON_ERROR_CHARTYPE
#define RAPIDJSON_ERROR_CHARTYPE char
#endif
// For example, on Windows, user can define this macro as _T(x)
///////////////////////////////////////////////////////////////////////////////
// RAPIDJSON_ERROR_STRING
//! Macro for converting string literial to RAPIDJSON_ERROR_CHARTYPE[].
/*! By default this conversion macro does nothing.
On Windows, user can define this macro as _T(x) for supporting both
unicode/non-unicode settings.
*/
#ifndef RAPIDJSON_ERROR_STRING
#define RAPIDJSON_ERROR_STRING(x) x
#endif
namespace
rapidjson
{
// User can dynamically change locale in runtime, e.g.:
// GetParseErrorFunc GetParseError = GetParseError_En; // or whatever
// const RAPIDJSON_ERROR_CHARTYPE* s = GetParseError(document.GetParseErrorCode());
//! Function pointer type of GetParseError().
/*! This is the prototype for GetParseError_X(), where X is a locale.
User can dynamically change locale in runtime, e.g.:
\code
GetParseErrorFunc GetParseError = GetParseError_En; // or whatever
const RAPIDJSON_ERROR_CHARTYPE* s = GetParseError(document.GetParseErrorCode());
\endcode
*/
typedef
const
RAPIDJSON_ERROR_CHARTYPE
*
(
*
GetParseErrorFunc
)(
ParseErrorCode
);
}
// namespace rapidjson
#endif // RAPIDJSON_ERROR_ERROR_H__
\ No newline at end of file
#endif // RAPIDJSON_ERROR_ERROR_H__
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment