Skip to content

Commit 8f757be

Browse files
committed
add namespace for jsoncpp & tinyxml2 libs.
1 parent 5f0d981 commit 8f757be

File tree

5 files changed

+97
-24
lines changed

5 files changed

+97
-24
lines changed

sdk/src/external/json/json-forwards.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,10 @@ license you like.
233233
# endif
234234

235235
#endif // if !defined(JSON_IS_AMALGAMATION)
236-
236+
namespace AlibabaCloud
237+
{
238+
namespace OSS
239+
{
237240
namespace Json {
238241
typedef int Int;
239242
typedef unsigned int UInt;
@@ -268,7 +271,8 @@ typedef UInt64 LargestUInt;
268271
#define JSONCPP_ISTREAM std::istream
269272
#endif // if JSONCPP_USING_SECURE_MEMORY
270273
} // end namespace Json
271-
274+
}
275+
}
272276
#endif // JSON_CONFIG_H_INCLUDED
273277

274278
// //////////////////////////////////////////////////////////////////////
@@ -295,6 +299,10 @@ typedef UInt64 LargestUInt;
295299
#if !defined(JSON_IS_AMALGAMATION)
296300
#include "config.h"
297301
#endif // if !defined(JSON_IS_AMALGAMATION)
302+
namespace AlibabaCloud
303+
{
304+
namespace OSS
305+
{
298306

299307
namespace Json {
300308

@@ -319,7 +327,8 @@ class ValueIterator;
319327
class ValueConstIterator;
320328

321329
} // namespace Json
322-
330+
}
331+
}
323332
#endif // JSON_FORWARDS_H_INCLUDED
324333

325334
// //////////////////////////////////////////////////////////////////////

sdk/src/external/json/json.h

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,10 @@ license you like.
267267
# endif
268268

269269
#endif // if !defined(JSON_IS_AMALGAMATION)
270-
270+
namespace AlibabaCloud
271+
{
272+
namespace OSS
273+
{
271274
namespace Json {
272275
typedef int Int;
273276
typedef unsigned int UInt;
@@ -302,7 +305,8 @@ typedef UInt64 LargestUInt;
302305
#define JSONCPP_ISTREAM std::istream
303306
#endif // if JSONCPP_USING_SECURE_MEMORY
304307
} // end namespace Json
305-
308+
}
309+
}
306310
#endif // JSON_CONFIG_H_INCLUDED
307311

308312
// //////////////////////////////////////////////////////////////////////
@@ -329,7 +333,10 @@ typedef UInt64 LargestUInt;
329333
#if !defined(JSON_IS_AMALGAMATION)
330334
#include "config.h"
331335
#endif // if !defined(JSON_IS_AMALGAMATION)
332-
336+
namespace AlibabaCloud
337+
{
338+
namespace OSS
339+
{
333340
namespace Json {
334341

335342
// writer.h
@@ -353,7 +360,8 @@ class ValueIterator;
353360
class ValueConstIterator;
354361

355362
} // namespace Json
356-
363+
}
364+
}
357365
#endif // JSON_FORWARDS_H_INCLUDED
358366

359367
// //////////////////////////////////////////////////////////////////////
@@ -382,7 +390,10 @@ class ValueConstIterator;
382390
#endif // if !defined(JSON_IS_AMALGAMATION)
383391

384392
#pragma pack(push, 8)
385-
393+
namespace AlibabaCloud
394+
{
395+
namespace OSS
396+
{
386397
namespace Json {
387398

388399
/** \brief Configuration passed to reader and writer.
@@ -426,7 +437,8 @@ class JSON_API Features {
426437
};
427438

428439
} // namespace Json
429-
440+
}
441+
}
430442
#pragma pack(pop)
431443

432444
#endif // CPPTL_JSON_FEATURES_H_INCLUDED
@@ -492,6 +504,10 @@ class JSON_API Features {
492504

493505
/** \brief JSON (JavaScript Object Notation).
494506
*/
507+
namespace AlibabaCloud
508+
{
509+
namespace OSS
510+
{
495511
namespace Json {
496512

497513
/** Base class for all exceptions we throw.
@@ -1317,12 +1333,13 @@ class JSON_API ValueIterator : public ValueIteratorBase {
13171333
};
13181334

13191335
} // namespace Json
1320-
1336+
}
1337+
}
13211338

13221339
namespace std {
13231340
/// Specialize std::swap() for Json::Value.
13241341
template<>
1325-
inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); }
1342+
inline void swap(AlibabaCloud::OSS::Json::Value& a, AlibabaCloud::OSS::Json::Value& b) { a.swap(b); }
13261343
}
13271344

13281345
#pragma pack(pop)
@@ -1372,7 +1389,10 @@ inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); }
13721389
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
13731390

13741391
#pragma pack(push, 8)
1375-
1392+
namespace AlibabaCloud
1393+
{
1394+
namespace OSS
1395+
{
13761396
namespace Json {
13771397

13781398
/** \brief Unserialize a <a HREF="http://www.json.org">JSON</a> document into a
@@ -1749,7 +1769,8 @@ bool JSON_API parseFromStream(
17491769
JSON_API JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM&, Value&);
17501770

17511771
} // namespace Json
1752-
1772+
}
1773+
}
17531774
#pragma pack(pop)
17541775

17551776
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
@@ -1794,7 +1815,10 @@ JSON_API JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM&, Value&);
17941815
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
17951816

17961817
#pragma pack(push, 8)
1797-
1818+
namespace AlibabaCloud
1819+
{
1820+
namespace OSS
1821+
{
17981822
namespace Json {
17991823

18001824
class Value;
@@ -2120,7 +2144,8 @@ JSONCPP_STRING JSON_API valueToQuotedString(const char* value);
21202144
JSON_API JSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM&, const Value& root);
21212145

21222146
} // namespace Json
2123-
2147+
}
2148+
}
21242149
#pragma pack(pop)
21252150

21262151
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)

sdk/src/external/json/jsoncpp.cpp

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ license you like.
107107
*
108108
* It is an internal header that must not be exposed.
109109
*/
110+
namespace AlibabaCloud
111+
{
112+
namespace OSS
113+
{
110114

111115
namespace Json {
112116
static char getDecimalPoint() {
@@ -196,7 +200,8 @@ static inline void fixNumericLocaleInput(char* begin, char* end) {
196200
}
197201

198202
} // namespace Json {
199-
203+
}
204+
}
200205
#endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED
201206

202207
// //////////////////////////////////////////////////////////////////////
@@ -265,6 +270,10 @@ static inline void fixNumericLocaleInput(char* begin, char* end) {
265270
#endif
266271

267272
static size_t const stackLimit_g = JSONCPP_DEPRECATED_STACK_LIMIT; // see readValue()
273+
namespace AlibabaCloud
274+
{
275+
namespace OSS
276+
{
268277

269278
namespace Json {
270279

@@ -2272,7 +2281,8 @@ JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM& sin, Value& root) {
22722281
}
22732282

22742283
} // namespace Json
2275-
2284+
}
2285+
}
22762286
// //////////////////////////////////////////////////////////////////////
22772287
// End of content of file: src/lib_json/json_reader.cpp
22782288
// //////////////////////////////////////////////////////////////////////
@@ -2292,6 +2302,10 @@ JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM& sin, Value& root) {
22922302
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
22932303

22942304
// included by json_value.cpp
2305+
namespace AlibabaCloud
2306+
{
2307+
namespace OSS
2308+
{
22952309

22962310
namespace Json {
22972311

@@ -2453,7 +2467,8 @@ ValueIterator& ValueIterator::operator=(const SelfType& other) {
24532467
}
24542468

24552469
} // namespace Json
2456-
2470+
}
2471+
}
24572472
// //////////////////////////////////////////////////////////////////////
24582473
// End of content of file: src/lib_json/json_valueiterator.inl
24592474
// //////////////////////////////////////////////////////////////////////
@@ -2489,6 +2504,10 @@ ValueIterator& ValueIterator::operator=(const SelfType& other) {
24892504
#include <algorithm> // min()
24902505

24912506
#define JSON_ASSERT_UNREACHABLE assert(false)
2507+
namespace AlibabaCloud
2508+
{
2509+
namespace OSS
2510+
{
24922511

24932512
namespace Json {
24942513

@@ -2644,7 +2663,8 @@ static inline void releaseStringValue(char* value, unsigned) {
26442663
#endif // JSONCPP_USING_SECURE_MEMORY
26452664

26462665
} // namespace Json
2647-
2666+
}
2667+
}
26482668
// //////////////////////////////////////////////////////////////////
26492669
// //////////////////////////////////////////////////////////////////
26502670
// //////////////////////////////////////////////////////////////////
@@ -2656,6 +2676,10 @@ static inline void releaseStringValue(char* value, unsigned) {
26562676

26572677
#include "json_valueiterator.inl"
26582678
#endif // if !defined(JSON_IS_AMALGAMATION)
2679+
namespace AlibabaCloud
2680+
{
2681+
namespace OSS
2682+
{
26592683

26602684
namespace Json {
26612685
#if JSON_USE_EXCEPTION
@@ -4139,7 +4163,8 @@ Value& Path::make(Value& root) const {
41394163
}
41404164

41414165
} // namespace Json
4142-
4166+
}
4167+
}
41434168
// //////////////////////////////////////////////////////////////////////
41444169
// End of content of file: src/lib_json/json_value.cpp
41454170
// //////////////////////////////////////////////////////////////////////
@@ -4227,6 +4252,10 @@ Value& Path::make(Value& root) const {
42274252
// Disable warning about strdup being deprecated.
42284253
#pragma warning(disable : 4996)
42294254
#endif
4255+
namespace AlibabaCloud
4256+
{
4257+
namespace OSS
4258+
{
42304259

42314260
namespace Json {
42324261

@@ -5386,7 +5415,8 @@ JSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM& sout, Value const& root) {
53865415
}
53875416

53885417
} // namespace Json
5389-
5418+
}
5419+
}
53905420
// //////////////////////////////////////////////////////////////////////
53915421
// End of content of file: src/lib_json/json_writer.cpp
53925422
// //////////////////////////////////////////////////////////////////////

sdk/src/external/tinyxml2/tinyxml2.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ static const unsigned char TIXML_UTF_LEAD_0 = 0xefU;
116116
static const unsigned char TIXML_UTF_LEAD_1 = 0xbbU;
117117
static const unsigned char TIXML_UTF_LEAD_2 = 0xbfU;
118118

119-
119+
namespace AlibabaCloud
120+
{
121+
namespace OSS
122+
{
120123
namespace tinyxml2
121124
{
122125

@@ -2825,3 +2828,5 @@ bool XMLPrinter::Visit( const XMLUnknown& unknown )
28252828
}
28262829

28272830
} // namespace tinyxml2
2831+
}
2832+
}

sdk/src/external/tinyxml2/tinyxml2.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ static const int TIXML2_PATCH_VERSION = 0;
112112
// attack that can result from ill, malicious, or even correctly formed XML,
113113
// so there needs to be a limit in place.
114114
static const int TINYXML2_MAX_ELEMENT_DEPTH = 100;
115-
115+
namespace AlibabaCloud
116+
{
117+
namespace OSS
118+
{
116119
namespace tinyxml2
117120
{
118121
class XMLDocument;
@@ -2306,7 +2309,8 @@ class TINYXML2_LIB XMLPrinter : public XMLVisitor
23062309

23072310

23082311
} // tinyxml2
2309-
2312+
}
2313+
}
23102314

23112315
#if defined(_MSC_VER)
23122316
# pragma warning(pop)

0 commit comments

Comments
 (0)