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
549dcb75
Commit
549dcb75
authored
Nov 06, 2014
by
Philipp A. Hartmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*.h: move to namespace macros
parent
55757ff4
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
63 additions
and
60 deletions
+63
-60
allocators.h
include/rapidjson/allocators.h
+2
-2
document.h
include/rapidjson/document.h
+2
-2
encodedstream.h
include/rapidjson/encodedstream.h
+2
-2
encodings.h
include/rapidjson/encodings.h
+2
-2
en.h
include/rapidjson/error/en.h
+2
-2
error.h
include/rapidjson/error/error.h
+2
-2
filereadstream.h
include/rapidjson/filereadstream.h
+2
-2
filestream.h
include/rapidjson/filestream.h
+2
-2
filewritestream.h
include/rapidjson/filewritestream.h
+2
-2
dtoa.h
include/rapidjson/internal/dtoa.h
+2
-2
itoa.h
include/rapidjson/internal/itoa.h
+2
-2
meta.h
include/rapidjson/internal/meta.h
+8
-8
pow10.h
include/rapidjson/internal/pow10.h
+2
-2
stack.h
include/rapidjson/internal/stack.h
+2
-2
strfunc.h
include/rapidjson/internal/strfunc.h
+2
-2
memorybuffer.h
include/rapidjson/memorybuffer.h
+2
-2
memorystream.h
include/rapidjson/memorystream.h
+2
-2
prettywriter.h
include/rapidjson/prettywriter.h
+2
-2
rapidjson.h
include/rapidjson/rapidjson.h
+15
-12
reader.h
include/rapidjson/reader.h
+2
-2
stringbuffer.h
include/rapidjson/stringbuffer.h
+2
-2
writer.h
include/rapidjson/writer.h
+2
-2
No files found.
include/rapidjson/allocators.h
View file @
549dcb75
...
...
@@ -23,7 +23,7 @@
#include "rapidjson.h"
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////////
// Allocator
...
...
@@ -240,6 +240,6 @@ private:
BaseAllocator
*
ownBaseAllocator_
;
//!< base allocator created by this object.
};
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_ENCODINGS_H_
include/rapidjson/document.h
View file @
549dcb75
...
...
@@ -66,7 +66,7 @@ RAPIDJSON_DIAG_OFF(effc++)
#include <utility> // std::move
#endif
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
// Forward declaration.
template
<
typename
Encoding
,
typename
Allocator
>
...
...
@@ -1899,7 +1899,7 @@ GenericValue<Encoding,Allocator>::GenericValue(const GenericValue<Encoding,Sourc
RawAssign
(
*
d
.
stack_
.
template
Pop
<
GenericValue
>
(
1
));
}
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#if defined(_MSC_VER) || defined(__GNUC__)
RAPIDJSON_DIAG_POP
...
...
include/rapidjson/encodedstream.h
View file @
549dcb75
...
...
@@ -28,7 +28,7 @@ RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
effc
++
)
#endif
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
//! Input byte stream wrapper with a statically bound encoding.
/*!
...
...
@@ -281,7 +281,7 @@ private:
#undef RAPIDJSON_ENCODINGS_FUNC
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#ifdef __GNUC__
RAPIDJSON_DIAG_POP
...
...
include/rapidjson/encodings.h
View file @
549dcb75
...
...
@@ -32,7 +32,7 @@ RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
effc
++
)
#endif
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////////
// Encoding
...
...
@@ -621,7 +621,7 @@ struct Transcoder<Encoding, Encoding> {
}
};
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#if defined(__GNUC__) || defined(_MSV_VER)
RAPIDJSON_DIAG_POP
...
...
include/rapidjson/error/en.h
View file @
549dcb75
...
...
@@ -23,7 +23,7 @@
#include "error.h"
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
//! Maps error code of parsing into error message.
/*!
...
...
@@ -66,6 +66,6 @@ inline const RAPIDJSON_ERROR_CHARTYPE* GetParseError_En(ParseErrorCode parseErro
}
}
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_ERROR_EN_H__
include/rapidjson/error/error.h
View file @
549dcb75
...
...
@@ -51,7 +51,7 @@
#define RAPIDJSON_ERROR_STRING(x) x
#endif
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////////
// ParseErrorCode
...
...
@@ -145,6 +145,6 @@ private:
*/
typedef
const
RAPIDJSON_ERROR_CHARTYPE
*
(
*
GetParseErrorFunc
)(
ParseErrorCode
);
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_ERROR_ERROR_H__
include/rapidjson/filereadstream.h
View file @
549dcb75
...
...
@@ -24,7 +24,7 @@
#include "rapidjson.h"
#include <cstdio>
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
//! File byte stream for input using fread().
/*!
...
...
@@ -89,6 +89,6 @@ private:
bool
eof_
;
};
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_FILESTREAM_H_
include/rapidjson/filestream.h
View file @
549dcb75
...
...
@@ -24,7 +24,7 @@
#include "rapidjson.h"
#include <cstdio>
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
//! (Deprecated) Wrapper of C file stream for input or output.
/*!
...
...
@@ -68,6 +68,6 @@ private:
size_t
count_
;
};
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_FILESTREAM_H_
include/rapidjson/filewritestream.h
View file @
549dcb75
...
...
@@ -24,7 +24,7 @@
#include "rapidjson.h"
#include <cstdio>
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
//! Wrapper of C file stream for input using fread().
/*!
...
...
@@ -92,6 +92,6 @@ inline void PutN(FileWriteStream& stream, char c, size_t n) {
stream
.
PutN
(
c
,
n
);
}
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_FILESTREAM_H_
include/rapidjson/internal/dtoa.h
View file @
549dcb75
...
...
@@ -34,7 +34,7 @@
#include "itoa.h" // GetDigitsLut()
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
namespace
internal
{
#ifdef __GNUC__
...
...
@@ -413,6 +413,6 @@ RAPIDJSON_DIAG_POP
#endif
}
// namespace internal
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_DTOA_
include/rapidjson/internal/itoa.h
View file @
549dcb75
...
...
@@ -21,7 +21,7 @@
#ifndef RAPIDJSON_ITOA_
#define RAPIDJSON_ITOA_
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
namespace
internal
{
inline
const
char
*
GetDigitsLut
()
{
...
...
@@ -301,6 +301,6 @@ inline char* i64toa(int64_t value, char* buffer) {
}
}
// namespace internal
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_ITOA_
include/rapidjson/internal/meta.h
View file @
549dcb75
...
...
@@ -39,7 +39,7 @@ RAPIDJSON_DIAG_OFF(6334)
#endif
//@cond RAPIDJSON_INTERNAL
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
namespace
internal
{
// Helper to wrap/convert arbitrary types to void, useful for arbitrary type matching
...
...
@@ -157,29 +157,29 @@ template <typename T> struct RemoveSfinaeTag;
template
<
typename
T
>
struct
RemoveSfinaeTag
<
SfinaeTag
&
(
*
)(
T
)
>
{
typedef
T
Type
;
};
#define RAPIDJSON_REMOVEFPTR_(type) \
typename
::
rapidjson
::
internal
::
RemoveSfinaeTag
\
<
::
rapidjson
::
internal
::
SfinaeTag
&
(
*
)
type
>::
Type
typename
::
RAPIDJSON_NAMESPACE
::
internal
::
RemoveSfinaeTag
\
<
::
RAPIDJSON_NAMESPACE
::
internal
::
SfinaeTag
&
(
*
)
type
>::
Type
#define RAPIDJSON_ENABLEIF(cond) \
typename
::
rapidjson
::
internal
::
EnableIf
\
typename
::
RAPIDJSON_NAMESPACE
::
internal
::
EnableIf
\
<
RAPIDJSON_REMOVEFPTR_
(
cond
)
>::
Type
*
=
NULL
#define RAPIDJSON_DISABLEIF(cond) \
typename
::
rapidjson
::
internal
::
DisableIf
\
typename
::
RAPIDJSON_NAMESPACE
::
internal
::
DisableIf
\
<
RAPIDJSON_REMOVEFPTR_
(
cond
)
>::
Type
*
=
NULL
#define RAPIDJSON_ENABLEIF_RETURN(cond,returntype) \
typename
::
rapidjson
::
internal
::
EnableIf
\
typename
::
RAPIDJSON_NAMESPACE
::
internal
::
EnableIf
\
<
RAPIDJSON_REMOVEFPTR_
(
cond
),
\
RAPIDJSON_REMOVEFPTR_
(
returntype
)
>::
Type
#define RAPIDJSON_DISABLEIF_RETURN(cond,returntype) \
typename
::
rapidjson
::
internal
::
DisableIf
\
typename
::
RAPIDJSON_NAMESPACE
::
internal
::
DisableIf
\
<
RAPIDJSON_REMOVEFPTR_
(
cond
),
\
RAPIDJSON_REMOVEFPTR_
(
returntype
)
>::
Type
}
// namespace internal
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
//@endcond
#if defined(__GNUC__) || defined(_MSC_VER)
...
...
include/rapidjson/internal/pow10.h
View file @
549dcb75
...
...
@@ -21,7 +21,7 @@
#ifndef RAPIDJSON_POW10_
#define RAPIDJSON_POW10_
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
namespace
internal
{
//! Computes integer powers of 10 in double (10.0^n).
...
...
@@ -54,6 +54,6 @@ inline double Pow10(int n) {
}
}
// namespace internal
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_POW10_
include/rapidjson/internal/stack.h
View file @
549dcb75
...
...
@@ -21,7 +21,7 @@
#ifndef RAPIDJSON_INTERNAL_STACK_H_
#define RAPIDJSON_INTERNAL_STACK_H_
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
namespace
internal
{
///////////////////////////////////////////////////////////////////////////////
...
...
@@ -178,6 +178,6 @@ private:
};
}
// namespace internal
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_STACK_H_
include/rapidjson/internal/strfunc.h
View file @
549dcb75
...
...
@@ -21,7 +21,7 @@
#ifndef RAPIDJSON_INTERNAL_STRFUNC_H_
#define RAPIDJSON_INTERNAL_STRFUNC_H_
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
namespace
internal
{
//! Custom strlen() which works on different character types.
...
...
@@ -38,6 +38,6 @@ inline SizeType StrLen(const Ch* s) {
}
}
// namespace internal
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_INTERNAL_STRFUNC_H_
include/rapidjson/memorybuffer.h
View file @
549dcb75
...
...
@@ -24,7 +24,7 @@
#include "rapidjson.h"
#include "internal/stack.h"
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
//! Represents an in-memory output byte stream.
/*!
...
...
@@ -71,6 +71,6 @@ inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) {
std
::
memset
(
memoryBuffer
.
stack_
.
Push
<
char
>
(
n
),
c
,
n
*
sizeof
(
c
));
}
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_MEMORYBUFFER_H_
include/rapidjson/memorystream.h
View file @
549dcb75
...
...
@@ -23,7 +23,7 @@
#include "rapidjson.h"
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
//! Represents an in-memory input byte stream.
/*!
...
...
@@ -62,6 +62,6 @@ struct MemoryStream {
size_t
size_
;
//!< Size of the stream.
};
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_MEMORYBUFFER_H_
include/rapidjson/prettywriter.h
View file @
549dcb75
...
...
@@ -28,7 +28,7 @@ RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
effc
++
)
#endif
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
//! Writer with indentation and spacing.
/*!
...
...
@@ -196,7 +196,7 @@ private:
PrettyWriter
&
operator
=
(
const
PrettyWriter
&
);
};
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#ifdef __GNUC__
RAPIDJSON_DIAG_POP
...
...
include/rapidjson/rapidjson.h
View file @
549dcb75
...
...
@@ -284,20 +284,20 @@
#ifdef RAPIDJSON_DOXYGEN_RUNNING
#define RAPIDJSON_NO_SIZETYPEDEFINE
#endif
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
//! Size type (for string lengths, array sizes, etc.)
/*! RapidJSON uses 32-bit array/string indices even on 64-bit platforms,
instead of using \c size_t. Users may override the SizeType by defining
\ref RAPIDJSON_NO_SIZETYPEDEFINE.
*/
typedef
unsigned
SizeType
;
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#endif
// always import std::size_t to rapidjson namespace
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
using
std
::
size_t
;
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
///////////////////////////////////////////////////////////////////////////////
// RAPIDJSON_ASSERT
...
...
@@ -321,12 +321,11 @@ using std::size_t;
// Adopt from boost
#ifndef RAPIDJSON_STATIC_ASSERT
//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
template
<
bool
x
>
struct
STATIC_ASSERTION_FAILURE
;
template
<>
struct
STATIC_ASSERTION_FAILURE
<
true
>
{
enum
{
value
=
1
};
};
template
<
int
x
>
struct
StaticAssertTest
{};
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#define RAPIDJSON_JOIN(X, Y) RAPIDJSON_DO_JOIN(X, Y)
#define RAPIDJSON_DO_JOIN(X, Y) RAPIDJSON_DO_JOIN2(X, Y)
...
...
@@ -344,8 +343,9 @@ template<int x> struct StaticAssertTest {};
\param x compile-time condition
\hideinitializer
*/
#define RAPIDJSON_STATIC_ASSERT(x) typedef ::rapidjson::StaticAssertTest<\
sizeof
(
::
rapidjson
::
STATIC_ASSERTION_FAILURE
<
bool
(
x
)
>
)
>
\
#define RAPIDJSON_STATIC_ASSERT(x) \
typedef
::
RAPIDJSON_NAMESPACE
::
StaticAssertTest
<
\
sizeof
(
::
RAPIDJSON_NAMESPACE
::
STATIC_ASSERTION_FAILURE
<
bool
(
x
)
>
)
>
\
RAPIDJSON_JOIN
(
StaticAssertTypedef
,
__LINE__
)
RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE
#endif
...
...
@@ -464,8 +464,11 @@ template<int x> struct StaticAssertTest {};
#include "allocators.h"
#include "encodings.h"
//! main RapidJSON namespace
namespace
rapidjson
{
/*! \namespace rapidjson
\brief main RapidJSON namespace
\see RAPIDJSON_NAMESPACE
*/
RAPIDJSON_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////////
// Stream
...
...
@@ -620,6 +623,6 @@ enum Type {
kNumberType
=
6
//!< number
};
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_RAPIDJSON_H_
include/rapidjson/reader.h
View file @
549dcb75
...
...
@@ -116,7 +116,7 @@ RAPIDJSON_DIAG_OFF(4702) // unreachable code
#include "error/error.h" // ParseErrorCode, ParseResult
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////////
// ParseFlag
...
...
@@ -1360,7 +1360,7 @@ private:
//! Reader with UTF8 encoding and default allocator.
typedef
GenericReader
<
UTF8
<>
,
UTF8
<>
>
Reader
;
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#ifdef _MSC_VER
RAPIDJSON_DIAG_POP
...
...
include/rapidjson/stringbuffer.h
View file @
549dcb75
...
...
@@ -24,7 +24,7 @@
#include "rapidjson.h"
#include "internal/stack.h"
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
//! Represents an in-memory output stream.
/*!
...
...
@@ -74,6 +74,6 @@ inline void PutN(GenericStringBuffer<UTF8<> >& stream, char c, size_t n) {
std
::
memset
(
stream
.
stack_
.
Push
<
char
>
(
n
),
c
,
n
*
sizeof
(
c
));
}
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_STRINGBUFFER_H_
include/rapidjson/writer.h
View file @
549dcb75
...
...
@@ -34,7 +34,7 @@ RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
4127
)
// conditional expression is constant
#endif
namespace
rapidjson
{
RAPIDJSON_NAMESPACE_BEGIN
//! JSON writer
/*! Writer implements the concept Handler.
...
...
@@ -380,7 +380,7 @@ inline bool Writer<StringBuffer>::WriteDouble(double d) {
return
true
;
}
}
// namespace rapidjson
RAPIDJSON_NAMESPACE_END
#ifdef _MSC_VER
RAPIDJSON_DIAG_POP
...
...
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