1
1
/*
2
2
Copyright (c) DataStax, Inc.
3
3
4
- This software can be used solely with DataStax Enterprise. Please consult the
5
- license at http://www.datastax.com/terms/datastax-dse-driver-license-terms
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
6
15
*/
7
16
8
- #ifndef __DSE_JSON_HPP_INCLUDED__
9
- #define __DSE_JSON_HPP_INCLUDED__
17
+ #ifndef __CASS_JSON_HPP_INCLUDED__
18
+ #define __CASS_JSON_HPP_INCLUDED__
10
19
11
20
#include " memory.hpp"
12
-
21
+ #define RAPIDJSON_NAMESPACE cass::rapidjson
22
+ #define RAPIDJSON_NAMESPACE_BEGIN namespace cass { namespace rapidjson {
23
+ #define RAPIDJSON_NAMESPACE_END } }
13
24
#define RAPIDJSON_NEW (x ) cass::Memory::allocate<x>
14
25
#define RAPIDJSON_DELETE (x ) cass::Memory::deallocate(x)
15
26
@@ -36,14 +47,14 @@ class Allocator {
36
47
}
37
48
};
38
49
39
- typedef rapidjson::GenericDocument<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<json::Allocator>, json::Allocator> Document;
40
- typedef rapidjson::GenericValue<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<json::Allocator> > Value;
41
- typedef rapidjson::GenericStringBuffer<rapidjson::UTF8<>, json::Allocator> StringBuffer;
50
+ typedef cass:: rapidjson::GenericDocument<cass:: rapidjson::UTF8<>, cass:: rapidjson::MemoryPoolAllocator<json::Allocator>, json::Allocator> Document;
51
+ typedef cass:: rapidjson::GenericValue<cass:: rapidjson::UTF8<>, cass:: rapidjson::MemoryPoolAllocator<json::Allocator> > Value;
52
+ typedef cass:: rapidjson::GenericStringBuffer<cass:: rapidjson::UTF8<>, json::Allocator> StringBuffer;
42
53
43
- template <typename OutputStream, typename SourceEncoding = rapidjson::UTF8<>, typename TargetEncoding = rapidjson::UTF8<>, typename StackAllocator = json::Allocator, unsigned writeFlags = rapidjson::kWriteDefaultFlags >
44
- class Writer : public rapidjson ::Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> {
54
+ template <typename OutputStream, typename SourceEncoding = cass:: rapidjson::UTF8<>, typename TargetEncoding = cass:: rapidjson::UTF8<>, typename StackAllocator = json::Allocator, unsigned writeFlags = cass:: rapidjson::kWriteDefaultFlags >
55
+ class Writer : public cass :: rapidjson::Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> {
45
56
public:
46
- typedef rapidjson::Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> Type;
57
+ typedef cass:: rapidjson::Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> Type;
47
58
48
59
explicit Writer (OutputStream& os, StackAllocator* stackAllocator = 0 , size_t levelDepth = Type::kDefaultLevelDepth ) :
49
60
Type(os, stackAllocator, levelDepth) { }
@@ -54,4 +65,4 @@ class Writer : public rapidjson::Writer<OutputStream, SourceEncoding, TargetEnco
54
65
55
66
} } // namespace cass::json
56
67
57
- #endif
68
+ #endif // __CASS_JSON_HPP_INCLUDED__
0 commit comments