Slash and burn EOL whitespace everywhere
This commit is contained in:
parent
d64c963e5e
commit
02240eff8c
94 changed files with 1059 additions and 1059 deletions
78
src/3rdparty/rapidjson/document.h
vendored
78
src/3rdparty/rapidjson/document.h
vendored
|
@ -1,5 +1,5 @@
|
|||
// Tencent is pleased to support the open source community by making RapidJSON available.
|
||||
//
|
||||
//
|
||||
// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
|
||||
//
|
||||
// Licensed under the MIT License (the "License"); you may not use this file except
|
||||
|
@ -7,9 +7,9 @@
|
|||
//
|
||||
// http://opensource.org/licenses/MIT
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software distributed
|
||||
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||
// Unless required by applicable law or agreed to in writing, software distributed
|
||||
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations under the License.
|
||||
|
||||
#ifndef RAPIDJSON_DOCUMENT_H_
|
||||
|
@ -116,7 +116,7 @@ class GenericDocument;
|
|||
But a compiler (IBM XL C/C++ for AIX) have reported to have problem with that so it moved as a namespace scope struct.
|
||||
https://code.google.com/p/rapidjson/issues/detail?id=64
|
||||
*/
|
||||
template <typename Encoding, typename Allocator>
|
||||
template <typename Encoding, typename Allocator>
|
||||
class GenericMember {
|
||||
public:
|
||||
GenericValue<Encoding, Allocator> name; //!< name of member (must be a string)
|
||||
|
@ -518,7 +518,7 @@ namespace internal {
|
|||
template <typename ValueType, typename T>
|
||||
struct TypeHelper {};
|
||||
|
||||
template<typename ValueType>
|
||||
template<typename ValueType>
|
||||
struct TypeHelper<ValueType, bool> {
|
||||
static bool Is(const ValueType& v) { return v.IsBool(); }
|
||||
static bool Get(const ValueType& v) { return v.GetBool(); }
|
||||
|
@ -526,7 +526,7 @@ struct TypeHelper<ValueType, bool> {
|
|||
static ValueType& Set(ValueType& v, bool data, typename ValueType::AllocatorType&) { return v.SetBool(data); }
|
||||
};
|
||||
|
||||
template<typename ValueType>
|
||||
template<typename ValueType>
|
||||
struct TypeHelper<ValueType, int> {
|
||||
static bool Is(const ValueType& v) { return v.IsInt(); }
|
||||
static int Get(const ValueType& v) { return v.GetInt(); }
|
||||
|
@ -534,7 +534,7 @@ struct TypeHelper<ValueType, int> {
|
|||
static ValueType& Set(ValueType& v, int data, typename ValueType::AllocatorType&) { return v.SetInt(data); }
|
||||
};
|
||||
|
||||
template<typename ValueType>
|
||||
template<typename ValueType>
|
||||
struct TypeHelper<ValueType, unsigned> {
|
||||
static bool Is(const ValueType& v) { return v.IsUint(); }
|
||||
static unsigned Get(const ValueType& v) { return v.GetUint(); }
|
||||
|
@ -562,7 +562,7 @@ struct TypeHelper<ValueType, unsigned long> {
|
|||
};
|
||||
#endif
|
||||
|
||||
template<typename ValueType>
|
||||
template<typename ValueType>
|
||||
struct TypeHelper<ValueType, int64_t> {
|
||||
static bool Is(const ValueType& v) { return v.IsInt64(); }
|
||||
static int64_t Get(const ValueType& v) { return v.GetInt64(); }
|
||||
|
@ -570,7 +570,7 @@ struct TypeHelper<ValueType, int64_t> {
|
|||
static ValueType& Set(ValueType& v, int64_t data, typename ValueType::AllocatorType&) { return v.SetInt64(data); }
|
||||
};
|
||||
|
||||
template<typename ValueType>
|
||||
template<typename ValueType>
|
||||
struct TypeHelper<ValueType, uint64_t> {
|
||||
static bool Is(const ValueType& v) { return v.IsUint64(); }
|
||||
static uint64_t Get(const ValueType& v) { return v.GetUint64(); }
|
||||
|
@ -578,7 +578,7 @@ struct TypeHelper<ValueType, uint64_t> {
|
|||
static ValueType& Set(ValueType& v, uint64_t data, typename ValueType::AllocatorType&) { return v.SetUint64(data); }
|
||||
};
|
||||
|
||||
template<typename ValueType>
|
||||
template<typename ValueType>
|
||||
struct TypeHelper<ValueType, double> {
|
||||
static bool Is(const ValueType& v) { return v.IsDouble(); }
|
||||
static double Get(const ValueType& v) { return v.GetDouble(); }
|
||||
|
@ -586,7 +586,7 @@ struct TypeHelper<ValueType, double> {
|
|||
static ValueType& Set(ValueType& v, double data, typename ValueType::AllocatorType&) { return v.SetDouble(data); }
|
||||
};
|
||||
|
||||
template<typename ValueType>
|
||||
template<typename ValueType>
|
||||
struct TypeHelper<ValueType, float> {
|
||||
static bool Is(const ValueType& v) { return v.IsFloat(); }
|
||||
static float Get(const ValueType& v) { return v.GetFloat(); }
|
||||
|
@ -594,7 +594,7 @@ struct TypeHelper<ValueType, float> {
|
|||
static ValueType& Set(ValueType& v, float data, typename ValueType::AllocatorType&) { return v.SetFloat(data); }
|
||||
};
|
||||
|
||||
template<typename ValueType>
|
||||
template<typename ValueType>
|
||||
struct TypeHelper<ValueType, const typename ValueType::Ch*> {
|
||||
typedef const typename ValueType::Ch* StringType;
|
||||
static bool Is(const ValueType& v) { return v.IsString(); }
|
||||
|
@ -604,7 +604,7 @@ struct TypeHelper<ValueType, const typename ValueType::Ch*> {
|
|||
};
|
||||
|
||||
#if RAPIDJSON_HAS_STDSTRING
|
||||
template<typename ValueType>
|
||||
template<typename ValueType>
|
||||
struct TypeHelper<ValueType, std::basic_string<typename ValueType::Ch> > {
|
||||
typedef std::basic_string<typename ValueType::Ch> StringType;
|
||||
static bool Is(const ValueType& v) { return v.IsString(); }
|
||||
|
@ -613,7 +613,7 @@ struct TypeHelper<ValueType, std::basic_string<typename ValueType::Ch> > {
|
|||
};
|
||||
#endif
|
||||
|
||||
template<typename ValueType>
|
||||
template<typename ValueType>
|
||||
struct TypeHelper<ValueType, typename ValueType::Array> {
|
||||
typedef typename ValueType::Array ArrayType;
|
||||
static bool Is(const ValueType& v) { return v.IsArray(); }
|
||||
|
@ -622,14 +622,14 @@ struct TypeHelper<ValueType, typename ValueType::Array> {
|
|||
static ValueType& Set(ValueType& v, ArrayType data, typename ValueType::AllocatorType&) { return v = data; }
|
||||
};
|
||||
|
||||
template<typename ValueType>
|
||||
template<typename ValueType>
|
||||
struct TypeHelper<ValueType, typename ValueType::ConstArray> {
|
||||
typedef typename ValueType::ConstArray ArrayType;
|
||||
static bool Is(const ValueType& v) { return v.IsArray(); }
|
||||
static ArrayType Get(const ValueType& v) { return v.GetArray(); }
|
||||
};
|
||||
|
||||
template<typename ValueType>
|
||||
template<typename ValueType>
|
||||
struct TypeHelper<ValueType, typename ValueType::Object> {
|
||||
typedef typename ValueType::Object ObjectType;
|
||||
static bool Is(const ValueType& v) { return v.IsObject(); }
|
||||
|
@ -638,7 +638,7 @@ struct TypeHelper<ValueType, typename ValueType::Object> {
|
|||
static ValueType& Set(ValueType& v, ObjectType data, typename ValueType::AllocatorType&) { return v = data; }
|
||||
};
|
||||
|
||||
template<typename ValueType>
|
||||
template<typename ValueType>
|
||||
struct TypeHelper<ValueType, typename ValueType::ConstObject> {
|
||||
typedef typename ValueType::ConstObject ObjectType;
|
||||
static bool Is(const ValueType& v) { return v.IsObject(); }
|
||||
|
@ -796,7 +796,7 @@ public:
|
|||
|
||||
//! Constructor for unsigned value.
|
||||
explicit GenericValue(unsigned u) RAPIDJSON_NOEXCEPT : data_() {
|
||||
data_.n.u64 = u;
|
||||
data_.n.u64 = u;
|
||||
data_.f.flags = (u & 0x80000000) ? kNumberUintFlag : (kNumberUintFlag | kIntFlag | kInt64Flag);
|
||||
}
|
||||
|
||||
|
@ -1030,14 +1030,14 @@ public:
|
|||
switch (GetType()) {
|
||||
case kObjectType: // Warning: O(n^2) inner-loop
|
||||
if (data_.o.size != rhs.data_.o.size)
|
||||
return false;
|
||||
return false;
|
||||
for (ConstMemberIterator lhsMemberItr = MemberBegin(); lhsMemberItr != MemberEnd(); ++lhsMemberItr) {
|
||||
typename RhsType::ConstMemberIterator rhsMemberItr = rhs.FindMember(lhsMemberItr->name);
|
||||
if (rhsMemberItr == rhs.MemberEnd() || lhsMemberItr->value != rhsMemberItr->value)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
|
||||
case kArrayType:
|
||||
if (data_.a.size != rhs.data_.a.size)
|
||||
return false;
|
||||
|
@ -1505,7 +1505,7 @@ public:
|
|||
\note Linear time complexity.
|
||||
*/
|
||||
void RemoveAllMembers() {
|
||||
RAPIDJSON_ASSERT(IsObject());
|
||||
RAPIDJSON_ASSERT(IsObject());
|
||||
DoClearMembers();
|
||||
}
|
||||
|
||||
|
@ -1638,7 +1638,7 @@ public:
|
|||
\note Linear time complexity.
|
||||
*/
|
||||
void Clear() {
|
||||
RAPIDJSON_ASSERT(IsArray());
|
||||
RAPIDJSON_ASSERT(IsArray());
|
||||
GenericValue* e = GetElementsPointer();
|
||||
for (GenericValue* v = e; v != e + data_.a.size; ++v)
|
||||
v->~GenericValue();
|
||||
|
@ -1844,7 +1844,7 @@ public:
|
|||
|
||||
//! Set this value as a string without copying source string.
|
||||
/*! This version has better performance with supplied length, and also support string containing null character.
|
||||
\param s source string pointer.
|
||||
\param s source string pointer.
|
||||
\param length The length of source string, excluding the trailing null terminator.
|
||||
\return The value itself for fluent API.
|
||||
\post IsString() == true && GetString() == s && GetStringLength() == length
|
||||
|
@ -1861,7 +1861,7 @@ public:
|
|||
|
||||
//! Set this value as a string by copying from source string.
|
||||
/*! This version has better performance with supplied length, and also support string containing null character.
|
||||
\param s source string.
|
||||
\param s source string.
|
||||
\param length The length of source string, excluding the trailing null terminator.
|
||||
\param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator().
|
||||
\return The value itself for fluent API.
|
||||
|
@ -1870,7 +1870,7 @@ public:
|
|||
GenericValue& SetString(const Ch* s, SizeType length, Allocator& allocator) { return SetString(StringRef(s, length), allocator); }
|
||||
|
||||
//! Set this value as a string by copying from source string.
|
||||
/*! \param s source string.
|
||||
/*! \param s source string.
|
||||
\param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator().
|
||||
\return The value itself for fluent API.
|
||||
\post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length
|
||||
|
@ -1955,10 +1955,10 @@ public:
|
|||
if (RAPIDJSON_UNLIKELY(!v->Accept(handler)))
|
||||
return false;
|
||||
return handler.EndArray(data_.a.size);
|
||||
|
||||
|
||||
case kStringType:
|
||||
return handler.String(GetString(), GetStringLength(), (data_.f.flags & kCopyFlag) != 0);
|
||||
|
||||
|
||||
default:
|
||||
RAPIDJSON_ASSERT(GetType() == kNumberType);
|
||||
if (IsDouble()) return handler.Double(data_.n.d);
|
||||
|
@ -2470,7 +2470,7 @@ private:
|
|||
typedef GenericValue<UTF8<> > Value;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// GenericDocument
|
||||
// GenericDocument
|
||||
|
||||
//! A document for parsing JSON text as DOM.
|
||||
/*!
|
||||
|
@ -2502,12 +2502,12 @@ public:
|
|||
}
|
||||
|
||||
//! Constructor
|
||||
/*! Creates an empty document which type is Null.
|
||||
/*! Creates an empty document which type is Null.
|
||||
\param allocator Optional allocator for allocating memory.
|
||||
\param stackCapacity Optional initial capacity of stack in bytes.
|
||||
\param stackAllocator Optional allocator for allocating memory for stack.
|
||||
*/
|
||||
GenericDocument(Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) :
|
||||
GenericDocument(Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) :
|
||||
allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_()
|
||||
{
|
||||
if (!allocator_)
|
||||
|
@ -2724,7 +2724,7 @@ public:
|
|||
GenericDocument& Parse(const Ch* str, size_t length) {
|
||||
return Parse<parseFlags, Encoding>(str, length);
|
||||
}
|
||||
|
||||
|
||||
GenericDocument& Parse(const Ch* str, size_t length) {
|
||||
return Parse<kParseDefaultFlags>(str, length);
|
||||
}
|
||||
|
@ -2744,7 +2744,7 @@ public:
|
|||
GenericDocument& Parse(const std::basic_string<Ch>& str) {
|
||||
return Parse<kParseDefaultFlags>(str);
|
||||
}
|
||||
#endif // RAPIDJSON_HAS_STDSTRING
|
||||
#endif // RAPIDJSON_HAS_STDSTRING
|
||||
|
||||
//!@}
|
||||
|
||||
|
@ -2809,16 +2809,16 @@ public:
|
|||
bool Uint64(uint64_t i) { new (stack_.template Push<ValueType>()) ValueType(i); return true; }
|
||||
bool Double(double d) { new (stack_.template Push<ValueType>()) ValueType(d); return true; }
|
||||
|
||||
bool RawNumber(const Ch* str, SizeType length, bool copy) {
|
||||
if (copy)
|
||||
bool RawNumber(const Ch* str, SizeType length, bool copy) {
|
||||
if (copy)
|
||||
new (stack_.template Push<ValueType>()) ValueType(str, length, GetAllocator());
|
||||
else
|
||||
new (stack_.template Push<ValueType>()) ValueType(str, length);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool String(const Ch* str, SizeType length, bool copy) {
|
||||
if (copy)
|
||||
bool String(const Ch* str, SizeType length, bool copy) {
|
||||
if (copy)
|
||||
new (stack_.template Push<ValueType>()) ValueType(str, length, GetAllocator());
|
||||
else
|
||||
new (stack_.template Push<ValueType>()) ValueType(str, length);
|
||||
|
@ -2826,7 +2826,7 @@ public:
|
|||
}
|
||||
|
||||
bool StartObject() { new (stack_.template Push<ValueType>()) ValueType(kObjectType); return true; }
|
||||
|
||||
|
||||
bool Key(const Ch* str, SizeType length, bool copy) { return String(str, length, copy); }
|
||||
|
||||
bool EndObject(SizeType memberCount) {
|
||||
|
@ -2836,7 +2836,7 @@ public:
|
|||
}
|
||||
|
||||
bool StartArray() { new (stack_.template Push<ValueType>()) ValueType(kArrayType); return true; }
|
||||
|
||||
|
||||
bool EndArray(SizeType elementCount) {
|
||||
ValueType* elements = stack_.template Pop<ValueType>(elementCount);
|
||||
stack_.template Top<ValueType>()->SetArrayRaw(elements, elementCount, GetAllocator());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue