Skip to content

Commit 8d110e7

Browse files
committed
added:jsoncpp into project
1 parent 4ad5a8b commit 8d110e7

25 files changed

+7644
-11
lines changed

XEngine_Source/StorageModule_APIHelp/StorageModule_APIHelp.vcxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@
7272
<PropertyGroup Label="UserMacros" />
7373
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7474
<LinkIncremental>true</LinkIncremental>
75-
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
75+
<IncludePath>$(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
7676
<LibraryPath>$(XEngine_Lib32);$(LibraryPath)</LibraryPath>
7777
</PropertyGroup>
7878
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
7979
<LinkIncremental>false</LinkIncremental>
80-
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
80+
<IncludePath>$(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
8181
<LibraryPath>$(XEngine_Lib32);$(LibraryPath)</LibraryPath>
8282
</PropertyGroup>
8383
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -87,7 +87,7 @@
8787
</PropertyGroup>
8888
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
8989
<LinkIncremental>false</LinkIncremental>
90-
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
90+
<IncludePath>$(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
9191
<LibraryPath>$(XEngine_Lib64);$(LibraryPath)</LibraryPath>
9292
</PropertyGroup>
9393
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

XEngine_Source/StorageModule_APIHelp/pch.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,17 @@ extern DWORD APIHelp_dwErrorCode;
6767
#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl")
6868
#pragma comment(lib,"XEngine_RfcComponents/RfcComponents_HttpServer")
6969
#pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi")
70+
#ifdef _DEBUG
71+
#ifdef _WIN64
72+
#pragma comment(lib,"../x64/Debug/jsoncpp")
73+
#else
74+
#pragma comment(lib,"../Debug/jsoncpp")
75+
#endif
76+
#else
77+
#ifdef _WIN64
78+
#pragma comment(lib,"../x64/Release/jsoncpp")
79+
#else
80+
#pragma comment(lib,"../Release/jsoncpp")
81+
#endif
82+
#endif
7083
#endif

XEngine_Source/StorageModule_Config/StorageModule_Config.vcxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,20 @@
7272
<PropertyGroup Label="UserMacros" />
7373
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7474
<LinkIncremental>true</LinkIncremental>
75-
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
75+
<IncludePath>$(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
7676
</PropertyGroup>
7777
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
7878
<LinkIncremental>false</LinkIncremental>
79-
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
80-
<LibraryPath>$(XEngine_Library);$(LibraryPath)</LibraryPath>
79+
<IncludePath>$(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
80+
<LibraryPath>$(XEngine_Lib32);$(LibraryPath)</LibraryPath>
8181
</PropertyGroup>
8282
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
8383
<LinkIncremental>true</LinkIncremental>
8484
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
8585
</PropertyGroup>
8686
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
8787
<LinkIncremental>false</LinkIncremental>
88-
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
88+
<IncludePath>$(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
8989
</PropertyGroup>
9090
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
9191
<ClCompile>

XEngine_Source/StorageModule_Config/pch.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,20 @@ using namespace std;
4444
// History:
4545
*********************************************************************/
4646
extern BOOL Config_IsErrorOccur;
47-
extern DWORD Config_dwErrorCode;
47+
extern DWORD Config_dwErrorCode;
48+
49+
#ifdef _WINDOWS
50+
#ifdef _DEBUG
51+
#ifdef _WIN64
52+
#pragma comment(lib,"../x64/Debug/jsoncpp")
53+
#else
54+
#pragma comment(lib,"../Debug/jsoncpp")
55+
#endif
56+
#else
57+
#ifdef _WIN64
58+
#pragma comment(lib,"../x64/Release/jsoncpp")
59+
#else
60+
#pragma comment(lib,"../Release/jsoncpp")
61+
#endif
62+
#endif
63+
#endif

XEngine_Source/StorageModule_Protocol/StorageModule_Protocol.vcxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@
7272
<PropertyGroup Label="UserMacros" />
7373
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7474
<LinkIncremental>true</LinkIncremental>
75-
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
75+
<IncludePath>$(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
7676
<LibraryPath>$(XEngine_Lib32);$(LibraryPath)</LibraryPath>
7777
</PropertyGroup>
7878
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
7979
<LinkIncremental>false</LinkIncremental>
80-
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
80+
<IncludePath>$(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
8181
<LibraryPath>$(XEngine_Lib32);$(LibraryPath)</LibraryPath>
8282
</PropertyGroup>
8383
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -87,7 +87,7 @@
8787
</PropertyGroup>
8888
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
8989
<LinkIncremental>false</LinkIncremental>
90-
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
90+
<IncludePath>$(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
9191
<LibraryPath>$(XEngine_Lib64);$(LibraryPath)</LibraryPath>
9292
</PropertyGroup>
9393
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

XEngine_Source/StorageModule_Protocol/pch.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,17 @@ extern DWORD Protocol_dwErrorCode;
6161

6262
#ifdef _WINDOWS
6363
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib")
64+
#ifdef _DEBUG
65+
#ifdef _WIN64
66+
#pragma comment(lib,"../x64/Debug/jsoncpp")
67+
#else
68+
#pragma comment(lib,"../Debug/jsoncpp")
69+
#endif
70+
#else
71+
#ifdef _WIN64
72+
#pragma comment(lib,"../x64/Release/jsoncpp")
73+
#else
74+
#pragma comment(lib,"../Release/jsoncpp")
75+
#endif
76+
#endif
6477
#endif

XEngine_Source/XEngine_StorageApp.sln

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StorageModule_Protocol", "S
2424
EndProject
2525
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XStorage_P2XPPeer", "XEngine_StorageComponents\XStorage_P2XPPeer\XStorage_P2XPPeer.vcxproj", "{C4BCB220-AA53-4FFE-9374-A8797C2D1B74}"
2626
EndProject
27+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XEngine_ThirdPart", "XEngine_ThirdPart", "{83E1D53F-3BB6-4CF2-AC05-52F9B37A8954}"
28+
EndProject
29+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jsoncpp", "XEngine_ThirdPart\jsoncpp\jsoncpp.vcxproj", "{F1736B3F-03A2-4FC7-B045-A12BA8D724FB}"
30+
EndProject
2731
Global
2832
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2933
Debug|x64 = Debug|x64
@@ -88,13 +92,22 @@ Global
8892
{C4BCB220-AA53-4FFE-9374-A8797C2D1B74}.Release|x64.Build.0 = Release|x64
8993
{C4BCB220-AA53-4FFE-9374-A8797C2D1B74}.Release|x86.ActiveCfg = Release|Win32
9094
{C4BCB220-AA53-4FFE-9374-A8797C2D1B74}.Release|x86.Build.0 = Release|Win32
95+
{F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x64.ActiveCfg = Debug|x64
96+
{F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x64.Build.0 = Debug|x64
97+
{F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x86.ActiveCfg = Debug|Win32
98+
{F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x86.Build.0 = Debug|Win32
99+
{F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|x64.ActiveCfg = Release|x64
100+
{F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|x64.Build.0 = Release|x64
101+
{F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|x86.ActiveCfg = Release|Win32
102+
{F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|x86.Build.0 = Release|Win32
91103
EndGlobalSection
92104
GlobalSection(SolutionProperties) = preSolution
93105
HideSolutionNode = FALSE
94106
EndGlobalSection
95107
GlobalSection(NestedProjects) = preSolution
96108
{CAEF9BAE-38FB-407C-8C83-87A97B3647D3} = {4FF9D547-65B4-4B26-923C-4207BAA3AACB}
97109
{C4BCB220-AA53-4FFE-9374-A8797C2D1B74} = {4FF9D547-65B4-4B26-923C-4207BAA3AACB}
110+
{F1736B3F-03A2-4FC7-B045-A12BA8D724FB} = {83E1D53F-3BB6-4CF2-AC05-52F9B37A8954}
98111
EndGlobalSection
99112
GlobalSection(ExtensibilityGlobals) = postSolution
100113
SolutionGuid = {B1A862E2-1FE4-4F3E-B84C-3479A0B3A783}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
2+
// Distributed under MIT license, or public domain if desired and
3+
// recognized in your jurisdiction.
4+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5+
6+
#ifndef JSON_ALLOCATOR_H_INCLUDED
7+
#define JSON_ALLOCATOR_H_INCLUDED
8+
9+
#include <cstring>
10+
#include <memory>
11+
12+
#pragma pack(push, 8)
13+
14+
namespace Json {
15+
template <typename T> class SecureAllocator {
16+
public:
17+
// Type definitions
18+
using value_type = T;
19+
using pointer = T*;
20+
using const_pointer = const T*;
21+
using reference = T&;
22+
using const_reference = const T&;
23+
using size_type = std::size_t;
24+
using difference_type = std::ptrdiff_t;
25+
26+
/**
27+
* Allocate memory for N items using the standard allocator.
28+
*/
29+
pointer allocate(size_type n) {
30+
// allocate using "global operator new"
31+
return static_cast<pointer>(::operator new(n * sizeof(T)));
32+
}
33+
34+
/**
35+
* Release memory which was allocated for N items at pointer P.
36+
*
37+
* The memory block is filled with zeroes before being released.
38+
*/
39+
void deallocate(pointer p, size_type n) {
40+
// memset_s is used because memset may be optimized away by the compiler
41+
memset_s(p, n * sizeof(T), 0, n * sizeof(T));
42+
// free using "global operator delete"
43+
::operator delete(p);
44+
}
45+
46+
/**
47+
* Construct an item in-place at pointer P.
48+
*/
49+
template <typename... Args> void construct(pointer p, Args&&... args) {
50+
// construct using "placement new" and "perfect forwarding"
51+
::new (static_cast<void*>(p)) T(std::forward<Args>(args)...);
52+
}
53+
54+
size_type max_size() const { return size_t(-1) / sizeof(T); }
55+
56+
pointer address(reference x) const { return std::addressof(x); }
57+
58+
const_pointer address(const_reference x) const { return std::addressof(x); }
59+
60+
/**
61+
* Destroy an item in-place at pointer P.
62+
*/
63+
void destroy(pointer p) {
64+
// destroy using "explicit destructor"
65+
p->~T();
66+
}
67+
68+
// Boilerplate
69+
SecureAllocator() {}
70+
template <typename U> SecureAllocator(const SecureAllocator<U>&) {}
71+
template <typename U> struct rebind { using other = SecureAllocator<U>; };
72+
};
73+
74+
template <typename T, typename U>
75+
bool operator==(const SecureAllocator<T>&, const SecureAllocator<U>&) {
76+
return true;
77+
}
78+
79+
template <typename T, typename U>
80+
bool operator!=(const SecureAllocator<T>&, const SecureAllocator<U>&) {
81+
return false;
82+
}
83+
84+
} // namespace Json
85+
86+
#pragma pack(pop)
87+
88+
#endif // JSON_ALLOCATOR_H_INCLUDED
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
2+
// Distributed under MIT license, or public domain if desired and
3+
// recognized in your jurisdiction.
4+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5+
6+
#ifndef JSON_ASSERTIONS_H_INCLUDED
7+
#define JSON_ASSERTIONS_H_INCLUDED
8+
9+
#include <cstdlib>
10+
#include <sstream>
11+
12+
#if !defined(JSON_IS_AMALGAMATION)
13+
#include "config.h"
14+
#endif // if !defined(JSON_IS_AMALGAMATION)
15+
16+
/** It should not be possible for a maliciously designed file to
17+
* cause an abort() or seg-fault, so these macros are used only
18+
* for pre-condition violations and internal logic errors.
19+
*/
20+
#if JSON_USE_EXCEPTION
21+
22+
// @todo <= add detail about condition in exception
23+
#define JSON_ASSERT(condition) \
24+
do { \
25+
if (!(condition)) { \
26+
Json::throwLogicError("assert json failed"); \
27+
} \
28+
} while (0)
29+
30+
#define JSON_FAIL_MESSAGE(message) \
31+
do { \
32+
OStringStream oss; \
33+
oss << message; \
34+
Json::throwLogicError(oss.str()); \
35+
abort(); \
36+
} while (0)
37+
38+
#else // JSON_USE_EXCEPTION
39+
40+
#define JSON_ASSERT(condition) assert(condition)
41+
42+
// The call to assert() will show the failure message in debug builds. In
43+
// release builds we abort, for a core-dump or debugger.
44+
#define JSON_FAIL_MESSAGE(message) \
45+
{ \
46+
OStringStream oss; \
47+
oss << message; \
48+
assert(false && oss.str().c_str()); \
49+
abort(); \
50+
}
51+
52+
#endif
53+
54+
#define JSON_ASSERT_MESSAGE(condition, message) \
55+
do { \
56+
if (!(condition)) { \
57+
JSON_FAIL_MESSAGE(message); \
58+
} \
59+
} while (0)
60+
61+
#endif // JSON_ASSERTIONS_H_INCLUDED

0 commit comments

Comments
 (0)