11/*
22 Copyright (c) DataStax, Inc.
33
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.
615*/
716
8- #ifndef __DSE_JSON_HPP_INCLUDED__
9- #define __DSE_JSON_HPP_INCLUDED__
17+ #ifndef __CASS_JSON_HPP_INCLUDED__
18+ #define __CASS_JSON_HPP_INCLUDED__
1019
1120#include " memory.hpp"
12-
21+ #define RAPIDJSON_NAMESPACE cass::rapidjson
22+ #define RAPIDJSON_NAMESPACE_BEGIN namespace cass { namespace rapidjson {
23+ #define RAPIDJSON_NAMESPACE_END } }
1324#define RAPIDJSON_NEW (x ) cass::Memory::allocate<x>
1425#define RAPIDJSON_DELETE (x ) cass::Memory::deallocate(x)
1526
@@ -36,14 +47,14 @@ class Allocator {
3647 }
3748};
3849
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;
4253
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> {
4556public:
46- typedef rapidjson::Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> Type;
57+ typedef cass:: rapidjson::Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> Type;
4758
4859 explicit Writer (OutputStream& os, StackAllocator* stackAllocator = 0 , size_t levelDepth = Type::kDefaultLevelDepth ) :
4960 Type(os, stackAllocator, levelDepth) { }
@@ -54,4 +65,4 @@ class Writer : public rapidjson::Writer<OutputStream, SourceEncoding, TargetEnco
5465
5566} } // namespace cass::json
5667
57- #endif
68+ #endif // __CASS_JSON_HPP_INCLUDED__
0 commit comments