RegalJson for parsing Config and Logging state from JSON

Added RegalConfigure Regal API
Refresh VC and XCode projects
Regal builds need jsonsl library now
This commit is contained in:
Nigel Stewart 2013-03-27 13:55:59 -05:00
parent 7d91dfed26
commit ac07860107
30 changed files with 3430 additions and 151 deletions

View file

@ -205,12 +205,13 @@ LIB.SRCS += src/md5/src/md5.c
endif
LIB.SRCS += src/jsonsl/jsonsl.c
LIB.CFLAGS += -DJSONSL_STATE_GENERIC=1
LIB.INCLUDE += -Isrc/zlib/include -Isrc/libpng/include
LIB.INCLUDE += -Isrc/zlib/include
LIB.INCLUDE += -Isrc/libpng/include
LIB.INCLUDE += -Isrc/mongoose
LIB.INCLUDE += -Isrc/md5/include
LIB.INCLUDE += -Isrc/lookup3
LIB.INCLUDE += -Isrc/jsonsl
# Optional flags

View file

@ -21,10 +21,10 @@ include $(regal_path)/build/regal.inc
# src_files should not include LOCAL_PATH
regal_src_files := $(patsubst %,$(regal_path)/%,$(REGAL.CXX))
regal_src_files += $(regal_path)/src/mongoose/mongoose.c $(regal_path)/src/md5/src/md5.c
regal_src_files += $(regal_path)/src/mongoose/mongoose.c $(regal_path)/src/md5/src/md5.c $(regal_path)/src/jsonsl/jsonsl.c
regal_src_files := $(patsubst $(LOCAL_PATH)/%,%,$(regal_src_files))
regal_c_includes := $(regal_path)/include $(regal_path)/src/regal $(regal_path)/src/boost $(regal_path)/src/mongoose $(regal_path)/src/md5/include $(regal_path)/src/lookup3
regal_c_includes := $(regal_path)/include $(regal_path)/src/regal $(regal_path)/src/boost $(regal_path)/src/mongoose $(regal_path)/src/md5/include $(regal_path)/src/lookup3 $(regal_path)/src/jsonsl
regal_c_includes := $(patsubst $(LOCAL_PATH)/../%,%,$(regal_c_includes))
regal_export_c_includes := $(regal_path)/include

View file

@ -150,6 +150,9 @@
BC3209D116F3A0E600D1A9E0 /* RegalCacheShader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalCacheShader.h; path = ../../../src/regal/RegalCacheShader.h; sourceTree = "<group>"; };
BC3209D216F3A0E600D1A9E0 /* RegalCacheTexture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalCacheTexture.cpp; path = ../../../src/regal/RegalCacheTexture.cpp; sourceTree = "<group>"; };
BC3209D316F3A0E600D1A9E0 /* RegalCacheTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalCacheTexture.h; path = ../../../src/regal/RegalCacheTexture.h; sourceTree = "<group>"; };
BC60A6B4170330700055437B /* RegalJson.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = RegalJson.cpp; path = ../../../src/regal/RegalJson.cpp; sourceTree = "<group>"; };
BC60A6B5170330700055437B /* RegalJson.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RegalJson.h; path = ../../../src/regal/RegalJson.h; sourceTree = "<group>"; };
BC60A6B6170330700055437B /* RegalJson.inl */ = {isa = PBXFileReference; lastKnownFileType = text; name = RegalJson.inl; path = ../../../src/regal/RegalJson.inl; sourceTree = "<group>"; };
BC640CA216554AA4007DEF69 /* RegalFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalFrame.cpp; path = ../../../src/regal/RegalFrame.cpp; sourceTree = "<group>"; };
BC640CA316554AA4007DEF69 /* RegalFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalFrame.h; path = ../../../src/regal/RegalFrame.h; sourceTree = "<group>"; };
BC6C912915EE3DC60056E4F7 /* RegalDispatchGlobal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatchGlobal.cpp; path = ../../../src/regal/RegalDispatchGlobal.cpp; sourceTree = "<group>"; };
@ -262,6 +265,9 @@
43FC5F6515C4619B00D0177C /* RegalIff.h */,
43FC5F6615C4619B00D0177C /* RegalInit.cpp */,
43FC5F6715C4619B00D0177C /* RegalInit.h */,
BC60A6B4170330700055437B /* RegalJson.cpp */,
BC60A6B5170330700055437B /* RegalJson.h */,
BC60A6B6170330700055437B /* RegalJson.inl */,
43FC5F6815C4619B00D0177C /* RegalLog.cpp */,
43FC5F6915C4619B00D0177C /* RegalLog.h */,
43FC5F6A15C4619B00D0177C /* RegalLookup.cpp */,

View file

@ -15,8 +15,9 @@
431D3C0E15C9B6F0009DD04F /* RegalFavicon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 431D3C0A15C9B6F0009DD04F /* RegalFavicon.cpp */; };
431D3C0F15C9B6F0009DD04F /* RegalFavicon.h in Headers */ = {isa = PBXBuildFile; fileRef = 431D3C0B15C9B6F0009DD04F /* RegalFavicon.h */; };
431D3C1015C9B6F0009DD04F /* RegalMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 431D3C0C15C9B6F0009DD04F /* RegalMac.cpp */; };
436E18CE17020093005BE93E /* jsonsl.c in Sources */ = {isa = PBXBuildFile; fileRef = 436E18CC17020093005BE93E /* jsonsl.c */; };
436E18CF17020093005BE93E /* jsonsl.h in Headers */ = {isa = PBXBuildFile; fileRef = 436E18CD17020093005BE93E /* jsonsl.h */; };
438D2C2B16DE668A005E03F6 /* RegalJson.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 438D2C1F16DE668A005E03F6 /* RegalJson.cpp */; };
438D2C2C16DE668A005E03F6 /* RegalJson.h in Headers */ = {isa = PBXBuildFile; fileRef = 438D2C2016DE668A005E03F6 /* RegalJson.h */; };
438D2C2D16DE668A005E03F6 /* RegalPixelConversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 438D2C2116DE668A005E03F6 /* RegalPixelConversions.cpp */; };
438D2C2E16DE668A005E03F6 /* RegalPixelConversions.h in Headers */ = {isa = PBXBuildFile; fileRef = 438D2C2216DE668A005E03F6 /* RegalPixelConversions.h */; };
438D2C2F16DE668A005E03F6 /* RegalPpca.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 438D2C2416DE668A005E03F6 /* RegalPpca.cpp */; };
@ -80,6 +81,7 @@
BC3209DF16F3A28900D1A9E0 /* RegalCacheTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3209DB16F3A28900D1A9E0 /* RegalCacheTexture.h */; };
BC456F1215D55F8E0080B420 /* RegalDispatchMissing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC456F1015D55F8E0080B420 /* RegalDispatchMissing.cpp */; };
BC456F1315D55F8E0080B420 /* RegalDispatchPpapi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC456F1115D55F8E0080B420 /* RegalDispatchPpapi.cpp */; };
BC60A6B217032F1A0055437B /* RegalJson.h in Headers */ = {isa = PBXBuildFile; fileRef = BC60A6B117032F1A0055437B /* RegalJson.h */; };
BC640C9C16554A52007DEF69 /* RegalFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC640C9A16554A52007DEF69 /* RegalFrame.cpp */; };
BC640C9D16554A52007DEF69 /* RegalFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = BC640C9B16554A52007DEF69 /* RegalFrame.h */; };
BC6C911D15EE3CDF0056E4F7 /* RegalDispatchGlobal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC6C911C15EE3CDF0056E4F7 /* RegalDispatchGlobal.cpp */; };
@ -109,8 +111,10 @@
431D3C0A15C9B6F0009DD04F /* RegalFavicon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalFavicon.cpp; path = ../../../src/regal/RegalFavicon.cpp; sourceTree = "<group>"; };
431D3C0B15C9B6F0009DD04F /* RegalFavicon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalFavicon.h; path = ../../../src/regal/RegalFavicon.h; sourceTree = "<group>"; };
431D3C0C15C9B6F0009DD04F /* RegalMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalMac.cpp; path = ../../../src/regal/RegalMac.cpp; sourceTree = "<group>"; };
436E18CA17020027005BE93E /* RegalJson.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = RegalJson.inl; path = ../../../src/regal/RegalJson.inl; sourceTree = "<group>"; };
436E18CC17020093005BE93E /* jsonsl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jsonsl.c; path = ../../../src/jsonsl/jsonsl.c; sourceTree = "<group>"; };
436E18CD17020093005BE93E /* jsonsl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsonsl.h; path = ../../../src/jsonsl/jsonsl.h; sourceTree = "<group>"; };
438D2C1F16DE668A005E03F6 /* RegalJson.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalJson.cpp; path = ../../../src/regal/RegalJson.cpp; sourceTree = "<group>"; };
438D2C2016DE668A005E03F6 /* RegalJson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalJson.h; path = ../../../src/regal/RegalJson.h; sourceTree = "<group>"; };
438D2C2116DE668A005E03F6 /* RegalPixelConversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalPixelConversions.cpp; path = ../../../src/regal/RegalPixelConversions.cpp; sourceTree = "<group>"; };
438D2C2216DE668A005E03F6 /* RegalPixelConversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalPixelConversions.h; path = ../../../src/regal/RegalPixelConversions.h; sourceTree = "<group>"; };
438D2C2316DE668A005E03F6 /* RegalPixelConversions.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = RegalPixelConversions.inl; path = ../../../src/regal/RegalPixelConversions.inl; sourceTree = "<group>"; };
@ -176,6 +180,7 @@
BC3209DB16F3A28900D1A9E0 /* RegalCacheTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalCacheTexture.h; path = ../../../src/regal/RegalCacheTexture.h; sourceTree = "<group>"; };
BC456F1015D55F8E0080B420 /* RegalDispatchMissing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatchMissing.cpp; path = ../../../src/regal/RegalDispatchMissing.cpp; sourceTree = "<group>"; };
BC456F1115D55F8E0080B420 /* RegalDispatchPpapi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatchPpapi.cpp; path = ../../../src/regal/RegalDispatchPpapi.cpp; sourceTree = "<group>"; };
BC60A6B117032F1A0055437B /* RegalJson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalJson.h; path = ../../../src/regal/RegalJson.h; sourceTree = "<group>"; };
BC640C9A16554A52007DEF69 /* RegalFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalFrame.cpp; path = ../../../src/regal/RegalFrame.cpp; sourceTree = "<group>"; };
BC640C9B16554A52007DEF69 /* RegalFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalFrame.h; path = ../../../src/regal/RegalFrame.h; sourceTree = "<group>"; };
BC6C911C15EE3CDF0056E4F7 /* RegalDispatchGlobal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalDispatchGlobal.cpp; path = ../../../src/regal/RegalDispatchGlobal.cpp; sourceTree = "<group>"; };
@ -207,6 +212,15 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
436E18CB17020061005BE93E /* jsonsl */ = {
isa = PBXGroup;
children = (
436E18CC17020093005BE93E /* jsonsl.c */,
436E18CD17020093005BE93E /* jsonsl.h */,
);
name = jsonsl;
sourceTree = "<group>";
};
43A6C1BB15C48CD90063667E = {
isa = PBXGroup;
children = (
@ -226,6 +240,7 @@
43A6C1D015C48CFA0063667E /* Regal */ = {
isa = PBXGroup;
children = (
436E18CB17020061005BE93E /* jsonsl */,
43A6C1D215C48D1F0063667E /* linear.h */,
BC020951160D1BD8003FAB99 /* md5 */,
43A6C22C15C48D2D0063667E /* mongoose */,
@ -279,7 +294,8 @@
43A6C1ED15C48D200063667E /* RegalInit.cpp */,
43A6C1EE15C48D200063667E /* RegalInit.h */,
438D2C1F16DE668A005E03F6 /* RegalJson.cpp */,
438D2C2016DE668A005E03F6 /* RegalJson.h */,
436E18CA17020027005BE93E /* RegalJson.inl */,
BC60A6B117032F1A0055437B /* RegalJson.h */,
43A6C1EF15C48D200063667E /* RegalLog.cpp */,
43A6C1F015C48D200063667E /* RegalLog.h */,
43A6C1F115C48D200063667E /* RegalLookup.cpp */,
@ -380,7 +396,6 @@
BCBEC70B167AD72700B38E16 /* RegalSharedMap.h in Headers */,
BCBEC70C167AD72700B38E16 /* RegalSharedPtr.h in Headers */,
BCBEC70E167AD72700B38E16 /* RegalSo.h in Headers */,
438D2C2C16DE668A005E03F6 /* RegalJson.h in Headers */,
438D2C2E16DE668A005E03F6 /* RegalPixelConversions.h in Headers */,
438D2C3016DE668A005E03F6 /* RegalPpca.h in Headers */,
438D2C3116DE668A005E03F6 /* RegalSystem.h in Headers */,
@ -395,6 +410,8 @@
430443F516F1658F0078C0F9 /* RegalScopedPtr.h in Headers */,
BC3209DD16F3A28900D1A9E0 /* RegalCacheShader.h in Headers */,
BC3209DF16F3A28900D1A9E0 /* RegalCacheTexture.h in Headers */,
436E18CF17020093005BE93E /* jsonsl.h in Headers */,
BC60A6B217032F1A0055437B /* RegalJson.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -490,6 +507,7 @@
430443F016F1656A0078C0F9 /* RegalXfer.cpp in Sources */,
BC3209DC16F3A28900D1A9E0 /* RegalCacheShader.cpp in Sources */,
BC3209DE16F3A28900D1A9E0 /* RegalCacheTexture.cpp in Sources */,
436E18CE17020093005BE93E /* jsonsl.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -527,6 +545,7 @@
../../../src/boost,
../../../src/mongoose,
../../../src/lookup3,
../../../src/jsonsl,
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_ACTIVE_ARCH = YES;
@ -562,6 +581,7 @@
../../../src/boost,
../../../src/mongoose,
../../../src/lookup3,
../../../src/jsonsl,
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
SDKROOT = macosx10.7;

View file

@ -37,6 +37,7 @@ REGAL.CXX += src/regal/RegalDispatchStaticEGL.cpp
REGAL.CXX += src/regal/RegalDispatchMissing.cpp
REGAL.CXX += src/regal/RegalPixelConversions.cpp
REGAL.CXX += src/regal/RegalHttp.cpp
REGAL.CXX += src/regal/RegalJson.cpp
REGAL.CXX += src/regal/RegalFavicon.cpp
REGAL.CXX += src/regal/RegalMac.cpp
REGAL.CXX += src/regal/RegalSo.cpp
@ -67,6 +68,8 @@ REGAL.H += src/regal/RegalXfer.h
REGAL.H += src/regal/RegalFrame.h
REGAL.H += src/regal/RegalHelper.h
REGAL.H += src/regal/RegalHttp.h
REGAL.H += src/regal/RegalJson.h
REGAL.H += src/regal/RegalJson.inl
REGAL.H += src/regal/RegalIff.h
REGAL.H += src/regal/RegalInit.h
REGAL.H += src/regal/RegalLog.h

View file

@ -13,4 +13,6 @@ REGALTEST.CXX += tests/testRegalState.cpp
REGALTEST.CXX += tests/testRegalPpa.cpp
REGALTEST.CXX += tests/testRegalPpca.cpp
REGALTEST.CXX += tests/testRegalHelper.cpp
REGALTEST.CXX += tests/testRegalToken.cpp
REGALTEST.CXX += tests/testRegalJson.cpp
REGALTEST.CXX += tests/RegalDispatchGMock.cpp

View file

@ -74,7 +74,7 @@
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>REGAL_NO_SQUISH=1;_ITERATOR_DEBUG_LEVEL=0;REGAL_WIN_TLS=1;REGAL_DECL_EXPORT;REGAL_SYS_WGL_DECLARE_WGL;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -114,7 +114,7 @@
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>REGAL_NO_SQUISH=1;_ITERATOR_DEBUG_LEVEL=0;REGAL_WIN_TLS=1;REGAL_DECL_EXPORT;REGAL_SYS_WGL_DECLARE_WGL;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -153,7 +153,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>REGAL_NO_SQUISH=1;_ITERATOR_DEBUG_LEVEL=0;REGAL_WIN_TLS=1;REGAL_DECL_EXPORT;REGAL_SYS_WGL_DECLARE_WGL;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@ -193,7 +193,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>REGAL_NO_SQUISH=1;_ITERATOR_DEBUG_LEVEL=0;REGAL_WIN_TLS=1;REGAL_DECL_EXPORT;REGAL_SYS_WGL_DECLARE_WGL;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@ -279,6 +279,9 @@
<ClInclude Include="..\..\..\..\src\regal\RegalIff.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalInit.cpp" />
<ClInclude Include="..\..\..\..\src\regal\RegalInit.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalJson.cpp" />
<ClInclude Include="..\..\..\..\src\regal\RegalJson.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalJson.inl" />
<ClCompile Include="..\..\..\..\src\regal\RegalLog.cpp" />
<ClInclude Include="..\..\..\..\src\regal\RegalLog.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalLookup.cpp" />
@ -290,6 +293,7 @@
<ClInclude Include="..\..\..\..\src\regal\RegalObj.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalPixelConversions.cpp" />
<ClInclude Include="..\..\..\..\src\regal\RegalPixelConversions.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalPixelConversions.inl" />
<ClInclude Include="..\..\..\..\src\regal\RegalPpa.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalPpc.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalPpca.cpp" />

View file

@ -34,6 +34,13 @@ Project("{CF05FE22-B763-D96E-C64D-312608111C07}") = "Regaltest", "Regaltest.vcxp
{256E64B8-F766-061C-45F8-25B51B7CA24E} = {256E64B8-F766-061C-45F8-25B51B7CA24E}
{EF516F6A-1965-7089-C2CA-65778D394F08} = {EF516F6A-1965-7089-C2CA-65778D394F08}
{9C419167-D705-A241-8927-763A6F9A5016} = {9C419167-D705-A241-8927-763A6F9A5016}
{B2F73D1B-8FA3-518D-0F85-9AAD20EF1E1C} = {B2F73D1B-8FA3-518D-0F85-9AAD20EF1E1C}
{8772AF49-E799-D743-4AED-682CB7047DB9} = {8772AF49-E799-D743-4AED-682CB7047DB9}
{863337BC-C6F9-E4E8-C27D-2D6BAFF72E18} = {863337BC-C6F9-E4E8-C27D-2D6BAFF72E18}
{256E64B8-F766-061C-45F8-25B51B7CA24E} = {256E64B8-F766-061C-45F8-25B51B7CA24E}
{EF516F6A-1965-7089-C2CA-65778D394F08} = {EF516F6A-1965-7089-C2CA-65778D394F08}
{9C419167-D705-A241-8927-763A6F9A5016} = {9C419167-D705-A241-8927-763A6F9A5016}
{B2F73D1B-8FA3-518D-0F85-9AAD20EF1E1C} = {B2F73D1B-8FA3-518D-0F85-9AAD20EF1E1C}
{8772AF49-E799-D743-4AED-682CB7047DB9} = {8772AF49-E799-D743-4AED-682CB7047DB9}
EndProjectSection
EndProject

View file

@ -74,7 +74,7 @@
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>REGAL_NO_SQUISH=1;_ITERATOR_DEBUG_LEVEL=0;REGAL_WIN_TLS=1;REGAL_DECL_EXPORT;REGAL_SYS_WGL_DECLARE_WGL;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -114,7 +114,7 @@
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>REGAL_NO_SQUISH=1;_ITERATOR_DEBUG_LEVEL=0;REGAL_WIN_TLS=1;REGAL_DECL_EXPORT;REGAL_SYS_WGL_DECLARE_WGL;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -153,7 +153,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>REGAL_NO_SQUISH=1;_ITERATOR_DEBUG_LEVEL=0;REGAL_WIN_TLS=1;REGAL_DECL_EXPORT;REGAL_SYS_WGL_DECLARE_WGL;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@ -193,7 +193,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>REGAL_NO_SQUISH=1;_ITERATOR_DEBUG_LEVEL=0;REGAL_WIN_TLS=1;REGAL_DECL_EXPORT;REGAL_SYS_WGL_DECLARE_WGL;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@ -279,6 +279,9 @@
<ClInclude Include="..\..\..\..\src\regal\RegalIff.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalInit.cpp" />
<ClInclude Include="..\..\..\..\src\regal\RegalInit.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalJson.cpp" />
<ClInclude Include="..\..\..\..\src\regal\RegalJson.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalJson.inl" />
<ClCompile Include="..\..\..\..\src\regal\RegalLog.cpp" />
<ClInclude Include="..\..\..\..\src\regal\RegalLog.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalLookup.cpp" />
@ -290,6 +293,7 @@
<ClInclude Include="..\..\..\..\src\regal\RegalObj.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalPixelConversions.cpp" />
<ClInclude Include="..\..\..\..\src\regal\RegalPixelConversions.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalPixelConversions.inl" />
<ClInclude Include="..\..\..\..\src\regal\RegalPpa.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalPpc.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalPpca.cpp" />

View file

@ -74,7 +74,7 @@
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>REGAL_NO_SQUISH=1;_ITERATOR_DEBUG_LEVEL=0;REGAL_WIN_TLS=1;REGAL_NAMESPACE;REGAL_DECL_EXPORT;REGAL_SYS_WGL_DECLARE_WGL;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -114,7 +114,7 @@
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>REGAL_NO_SQUISH=1;_ITERATOR_DEBUG_LEVEL=0;REGAL_WIN_TLS=1;REGAL_NAMESPACE;REGAL_DECL_EXPORT;REGAL_SYS_WGL_DECLARE_WGL;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -153,7 +153,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>REGAL_NO_SQUISH=1;_ITERATOR_DEBUG_LEVEL=0;REGAL_WIN_TLS=1;REGAL_NAMESPACE;REGAL_DECL_EXPORT;REGAL_SYS_WGL_DECLARE_WGL;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@ -193,7 +193,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>REGAL_NO_SQUISH=1;_ITERATOR_DEBUG_LEVEL=0;REGAL_WIN_TLS=1;REGAL_NAMESPACE;REGAL_DECL_EXPORT;REGAL_SYS_WGL_DECLARE_WGL;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@ -279,6 +279,9 @@
<ClInclude Include="..\..\..\..\src\regal\RegalIff.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalInit.cpp" />
<ClInclude Include="..\..\..\..\src\regal\RegalInit.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalJson.cpp" />
<ClInclude Include="..\..\..\..\src\regal\RegalJson.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalJson.inl" />
<ClCompile Include="..\..\..\..\src\regal\RegalLog.cpp" />
<ClInclude Include="..\..\..\..\src\regal\RegalLog.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalLookup.cpp" />
@ -290,6 +293,7 @@
<ClInclude Include="..\..\..\..\src\regal\RegalObj.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalPixelConversions.cpp" />
<ClInclude Include="..\..\..\..\src\regal\RegalPixelConversions.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalPixelConversions.inl" />
<ClInclude Include="..\..\..\..\src\regal\RegalPpa.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalPpc.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalPpca.cpp" />

View file

@ -74,7 +74,7 @@
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>REGAL_NO_SQUISH=1;_ITERATOR_DEBUG_LEVEL=0;REGAL_WIN_TLS=1;REGAL_NAMESPACE;REGAL_DECL_EXPORT;REGAL_SYS_WGL_DECLARE_WGL;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -114,7 +114,7 @@
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>REGAL_NO_SQUISH=1;_ITERATOR_DEBUG_LEVEL=0;REGAL_WIN_TLS=1;REGAL_NAMESPACE;REGAL_DECL_EXPORT;REGAL_SYS_WGL_DECLARE_WGL;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -153,7 +153,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>REGAL_NO_SQUISH=1;_ITERATOR_DEBUG_LEVEL=0;REGAL_WIN_TLS=1;REGAL_NAMESPACE;REGAL_DECL_EXPORT;REGAL_SYS_WGL_DECLARE_WGL;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@ -193,7 +193,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../../src/boost;../../../../include;../../../../src/mongoose;../../../../src/lookup3;../../../../src/md5/include;../../../../src/libpng/include;../../../../src/zlib/include;../../../../src/squish;../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>REGAL_NO_SQUISH=1;_ITERATOR_DEBUG_LEVEL=0;REGAL_WIN_TLS=1;REGAL_NAMESPACE;REGAL_DECL_EXPORT;REGAL_SYS_WGL_DECLARE_WGL;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@ -279,6 +279,9 @@
<ClInclude Include="..\..\..\..\src\regal\RegalIff.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalInit.cpp" />
<ClInclude Include="..\..\..\..\src\regal\RegalInit.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalJson.cpp" />
<ClInclude Include="..\..\..\..\src\regal\RegalJson.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalJson.inl" />
<ClCompile Include="..\..\..\..\src\regal\RegalLog.cpp" />
<ClInclude Include="..\..\..\..\src\regal\RegalLog.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalLookup.cpp" />
@ -290,6 +293,7 @@
<ClInclude Include="..\..\..\..\src\regal\RegalObj.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalPixelConversions.cpp" />
<ClInclude Include="..\..\..\..\src\regal\RegalPixelConversions.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalPixelConversions.inl" />
<ClInclude Include="..\..\..\..\src\regal\RegalPpa.h" />
<ClInclude Include="..\..\..\..\src\regal\RegalPpc.h" />
<ClCompile Include="..\..\..\..\src\regal\RegalPpca.cpp" />

View file

@ -91,7 +91,7 @@
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>gtestlib.lib;regallib.lib;mongooselib.lib;md5lib.lib;pnglib.lib;zlib.lib;advapi32.lib;gdi32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>gtestlib.lib;regallib.lib;mongooselib.lib;md5lib.lib;pnglib.lib;zlib.lib;jsonsllib.lib;advapi32.lib;gdi32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>Release\Win32\regaltest.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>Release\Win32\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@ -132,7 +132,7 @@
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>gtestlib.lib;regallib.lib;mongooselib.lib;md5lib.lib;pnglib.lib;zlib.lib;advapi32.lib;gdi32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>gtestlib.lib;regallib.lib;mongooselib.lib;md5lib.lib;pnglib.lib;zlib.lib;jsonsllib.lib;advapi32.lib;gdi32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>Release\x64\regaltest.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>Release\x64\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@ -170,7 +170,7 @@
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>gtestlib.lib;regallib.lib;mongooselib.lib;md5lib.lib;pnglib.lib;zlib.lib;advapi32.lib;gdi32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>gtestlib.lib;regallib.lib;mongooselib.lib;md5lib.lib;pnglib.lib;zlib.lib;jsonsllib.lib;advapi32.lib;gdi32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>Debug\Win32\regaltest.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>Debug\Win32\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@ -210,7 +210,7 @@
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>gtestlib.lib;regallib.lib;mongooselib.lib;md5lib.lib;pnglib.lib;zlib.lib;advapi32.lib;gdi32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>gtestlib.lib;regallib.lib;mongooselib.lib;md5lib.lib;pnglib.lib;zlib.lib;jsonsllib.lib;advapi32.lib;gdi32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>Debug\x64\regaltest.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>Debug\x64\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@ -232,11 +232,13 @@
<ItemGroup>
<ClCompile Include="..\..\..\..\tests\RegalDispatchGMock.cpp" />
<ClCompile Include="..\..\..\..\tests\testRegalHelper.cpp" />
<ClCompile Include="..\..\..\..\tests\testRegalJson.cpp" />
<ClCompile Include="..\..\..\..\tests\testRegalPixelConversions.cpp" />
<ClCompile Include="..\..\..\..\tests\testRegalPpa.cpp" />
<ClCompile Include="..\..\..\..\tests\testRegalPpca.cpp" />
<ClCompile Include="..\..\..\..\tests\testRegalState.cpp" />
<ClCompile Include="..\..\..\..\tests\testRegalTexC.cpp" />
<ClCompile Include="..\..\..\..\tests\testRegalToken.cpp" />
<ClCompile Include="..\..\..\..\tests\testStringList.cpp" />
<ClCompile Include="..\..\..\..\tests\test_main.cpp" />
</ItemGroup>

View file

@ -91,7 +91,7 @@
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>winmm.lib;ws2_32.lib;regalglutlib.lib;regalglulib.lib;regallib.lib;mongooselib.lib;md5lib.lib;pnglib.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>winmm.lib;ws2_32.lib;regalglutlib.lib;regalglulib.lib;regallib.lib;mongooselib.lib;md5lib.lib;pnglib.lib;zlib.lib;jsonsllib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>Release\Win32\dreamtorus_static.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>Release\Win32\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@ -132,7 +132,7 @@
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>winmm.lib;ws2_32.lib;regalglutlib.lib;regalglulib.lib;regallib.lib;mongooselib.lib;md5lib.lib;pnglib.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>winmm.lib;ws2_32.lib;regalglutlib.lib;regalglulib.lib;regallib.lib;mongooselib.lib;md5lib.lib;pnglib.lib;zlib.lib;jsonsllib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>Release\x64\dreamtorus_static.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>Release\x64\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@ -170,7 +170,7 @@
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>winmm.lib;ws2_32.lib;regalglutlib.lib;regalglulib.lib;regallib.lib;mongooselib.lib;md5lib.lib;pnglib.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>winmm.lib;ws2_32.lib;regalglutlib.lib;regalglulib.lib;regallib.lib;mongooselib.lib;md5lib.lib;pnglib.lib;zlib.lib;jsonsllib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>Debug\Win32\dreamtorus_static.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>Debug\Win32\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@ -210,7 +210,7 @@
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>winmm.lib;ws2_32.lib;regalglutlib.lib;regalglulib.lib;regallib.lib;mongooselib.lib;md5lib.lib;pnglib.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>winmm.lib;ws2_32.lib;regalglutlib.lib;regalglulib.lib;regallib.lib;mongooselib.lib;md5lib.lib;pnglib.lib;zlib.lib;jsonsllib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>Debug\x64\dreamtorus_static.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>Debug\x64\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>

View file

@ -75,7 +75,7 @@
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>JSONSL_STATE_GENERIC=1;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
@ -115,7 +115,7 @@
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>JSONSL_STATE_GENERIC=1;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
@ -154,7 +154,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>JSONSL_STATE_GENERIC=1;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
@ -194,7 +194,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../../../../src/jsonsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>JSONSL_STATE_GENERIC=1;_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS=1;WIN32;_WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>

View file

@ -35872,6 +35872,11 @@ extern "C" {
typedef void (*RegalErrorCallback)(GLenum);
REGAL_DECL RegalErrorCallback RegalSetErrorCallback( RegalErrorCallback callback );
/* RegalConfigure is optional.
*/
REGAL_DECL void RegalConfigure(const char *json);
/* RegalShareContext is optional. It must be called before any call
* to RegalMakeCurrent. It specifies that a context is sharing state
* with one already known to Regal.

View file

@ -143,6 +143,11 @@ extern "C" {
typedef void (*RegalErrorCallback)(GLenum);
REGAL_DECL RegalErrorCallback RegalSetErrorCallback( RegalErrorCallback callback );
/* RegalConfigure is optional.
*/
REGAL_DECL void RegalConfigure(const char *json);
/* RegalShareContext is optional. It must be called before any call
* to RegalMakeCurrent. It specifies that a context is sharing state
* with one already known to Regal.

View file

@ -29,7 +29,7 @@ typedef unsigned char jsonsl_uchar_t;
#endif /* JSONSL_USE_WCHAR */
/* Stolen from http-parser.h, and possibly others */
#if defined(_WIN32) && !defined(__MINGW32__)
#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600)
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
@ -48,8 +48,6 @@ typedef int ssize_t;
#if (!defined(JSONSL_STATE_GENERIC)) && (!defined(JSONSL_STATE_USER_FIELDS))
#warning "JSONSL_STATE_USER_FIELDS not defined. Define this for extra structure fields"
#warning "or define JSONSL_STATE_GENERIC"
#define JSONSL_STATE_GENERIC
#endif /* !defined JSONSL_STATE_GENERIC */

View file

@ -131,9 +131,6 @@ namespace Config {
#ifndef REGAL_NO_GETENV
const char *tmp;
tmp = GetEnv( "REGAL_CONFIG_FILE" );
if (tmp) configFile = tmp;
#if !REGAL_FORCE_ES1_PROFILE
tmp = GetEnv( "REGAL_FORCE_ES1_PROFILE" );
if (tmp) forceES1Profile = atoi(tmp)!=0;
@ -517,6 +514,7 @@ namespace Config {
void
writeJSON(Json::Output &jo)
{
#if !REGAL_NO_JSON
jo.object("config");
jo.member("configFile", configFile);
@ -554,8 +552,10 @@ namespace Config {
jo.object("enable");
jo.member("ppa", enableEmuPpa);
jo.member("ppca", enableEmuPpca);
jo.member("obj", enableEmuObj);
jo.member("bin", enableEmuBin);
jo.member("xfer", enableEmuXfer);
jo.member("dsa", enableEmuDsa);
jo.member("iff", enableEmuIff);
jo.member("so", enableEmuSo);
@ -566,8 +566,10 @@ namespace Config {
jo.object("force");
jo.member("ppa", forceEmuPpa);
jo.member("ppca", forceEmuPpca);
jo.member("obj", forceEmuObj);
jo.member("bin", forceEmuBin);
jo.member("xfer", forceEmuXfer);
jo.member("dsa", forceEmuDsa);
jo.member("iff", forceEmuIff);
jo.member("so", forceEmuSo);
@ -581,13 +583,22 @@ namespace Config {
jo.end();
jo.object("frame");
jo.member("limit", frameLimit);
jo.member("md5Color", frameMd5Color);
jo.member("md5Stencil", frameMd5Stencil);
jo.member("md5Depth", frameMd5Depth);
jo.member("saveColor", frameSaveColor);
jo.member("saveStencil", frameSaveStencil);
jo.member("saveDepth", frameSaveDepth);
jo.member("limit", frameLimit);
jo.object("md5");
jo.member("color", frameMd5Color);
jo.member("stencil", frameMd5Stencil);
jo.member("depth", frameMd5Depth);
jo.object("mask");
jo.member("color", frameMd5ColorMask);
jo.member("stencil", frameMd5StencilMask);
jo.member("depth", frameMd5DepthMask);
jo.end();
jo.end();
jo.object("save");
jo.member("color", frameSaveColor);
jo.member("stencil", frameSaveStencil);
jo.member("depth", frameSaveDepth);
jo.end();
jo.end();
jo.object("cache");
@ -602,6 +613,7 @@ namespace Config {
jo.end();
jo.end();
#endif // !REGAL_NO_JSON
}
}

View file

@ -227,15 +227,21 @@ namespace Emu {
#if REGAL_SYS_ES2
if (ctx.isES2())
{
#if 0
filtered = true;
switch (pname ) {
case GL_PACK_ALIGNMENT:
retVal = 1;
break;
/* just a test
case GL_PACK_ALIGNMENT:
retVal = 1;
break;
*/
default:
filtered = false;
break;
}
#else
filtered = false;
#endif
if (filtered)
{
Warning( "Regal does not support ", GLenumToString(pname), " as pname for glGet for ES 2.0 profile - skipping." );

View file

@ -42,6 +42,7 @@ using namespace std;
#include "RegalLog.h"
#include "RegalInit.h"
#include "RegalHttp.h"
#include "RegalJson.h"
#include "RegalToken.h"
#include "RegalConfig.h"
#include "RegalContext.h"
@ -84,12 +85,30 @@ Init::Init()
return;
#endif
// If a JSON config file is to be used, parse it first
#ifndef REGAL_NO_GETENV
const char *tmp = GetEnv( "REGAL_CONFIG_FILE" );
if (tmp) Config::configFile = tmp;
#endif
#ifdef REGAL_CONFIG_FILE
Config::configFile = REGAL_EQUOTE(REGAL_CONFIG_FILE);
#endif
if (Config::configFile.length())
{
bool ok = Json::Parser::parseFile(Config::configFile);
if (!ok)
Warning("Failed to parse configuration from ",Config::configFile);
}
//
Logging::Init();
Config::Init();
Http::Init();
// TODO - read configuration file
Http::Start();
}
@ -337,6 +356,14 @@ Init::setErrorCallback(RegalErrorCallback callback)
return context ? context->err.callback = callback : NULL;
}
void
Init::configure(const char *json)
{
bool ok = Json::Parser::parseString(json);
if (!ok)
Warning("Failed to parse configuration from RegalConfigure call.");
}
void
Init::shareContext(RegalSystemContext a, RegalSystemContext b)
{
@ -460,6 +487,11 @@ RegalErrorCallback RegalSetErrorCallback(RegalErrorCallback callback)
return ::REGAL_NAMESPACE_INTERNAL::Init::setErrorCallback(callback);
}
void RegalConfigure(const char *json)
{
::REGAL_NAMESPACE_INTERNAL::Init::configure(json);
}
REGAL_DECL void RegalShareContext(RegalSystemContext a, RegalSystemContext b)
{
::REGAL_NAMESPACE_INTERNAL::Init::shareContext(a,b);

View file

@ -84,6 +84,8 @@ public:
static RegalErrorCallback setErrorCallback(RegalErrorCallback callback);
static void configure(const char *json);
static void shareContext(RegalSystemContext a, RegalSystemContext b);
#if REGAL_SYS_PPAPI

View file

@ -1,9 +1,6 @@
/*
Copyright (c) 2011-2013 NVIDIA Corporation
Copyright (c) 2011-2013 Cass Everitt
Copyright (c) 2012-2013 Scott Nations
Copyright (c) 2012 Mathias Schott
Copyright (c) 2012-2013 Nigel Stewart
Copyright (c) 2013 Nigel Stewart
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
@ -34,10 +31,542 @@
REGAL_GLOBAL_BEGIN
#include "RegalLog.h"
#include "RegalConfig.h"
#include "RegalJson.h"
#include "RegalJson.inl"
#include <jsonsl.h>
using namespace std;
REGAL_GLOBAL_END
REGAL_NAMESPACE_BEGIN
namespace Json {
const Object parent[JSON_UNDEFINED+1] =
{
JSON_ROOT,
JSON_ROOT,
JSON_REGAL,
JSON_REGAL_CONFIG,
JSON_REGAL_CONFIG_CACHE,
JSON_REGAL_CONFIG_CACHE,
JSON_REGAL_CONFIG_CACHE,
JSON_REGAL_CONFIG_CACHE,
JSON_REGAL_CONFIG_CACHE,
JSON_REGAL_CONFIG_CACHE,
JSON_REGAL_CONFIG_CACHE,
JSON_REGAL_CONFIG_CACHE,
JSON_REGAL_CONFIG,
JSON_REGAL_CONFIG,
JSON_REGAL_CONFIG_DISPATCH,
JSON_REGAL_CONFIG_DISPATCH_EMULATION,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE,
JSON_REGAL_CONFIG_DISPATCH,
JSON_REGAL_CONFIG_DISPATCH_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_ENABLE,
JSON_REGAL_CONFIG_DISPATCH,
JSON_REGAL_CONFIG_DISPATCH_FORCE,
JSON_REGAL_CONFIG,
JSON_REGAL_CONFIG_FORCE,
JSON_REGAL_CONFIG_FORCE,
JSON_REGAL_CONFIG_FORCE,
JSON_REGAL_CONFIG,
JSON_REGAL_CONFIG_FRAME,
JSON_REGAL_CONFIG_FRAME,
JSON_REGAL_CONFIG_FRAME_MD5,
JSON_REGAL_CONFIG_FRAME_MD5,
JSON_REGAL_CONFIG_FRAME_MD5,
JSON_REGAL_CONFIG_FRAME_MD5_MASK,
JSON_REGAL_CONFIG_FRAME_MD5_MASK,
JSON_REGAL_CONFIG_FRAME_MD5_MASK,
JSON_REGAL_CONFIG_FRAME_MD5,
JSON_REGAL_CONFIG_FRAME,
JSON_REGAL_CONFIG_FRAME_SAVE,
JSON_REGAL_CONFIG_FRAME_SAVE,
JSON_REGAL_CONFIG_FRAME_SAVE,
JSON_REGAL_CONFIG,
JSON_REGAL_CONFIG_SYSTEM,
JSON_REGAL_CONFIG_SYSTEM,
JSON_REGAL_CONFIG_SYSTEM,
JSON_REGAL_CONFIG_SYSTEM,
JSON_REGAL_CONFIG_SYSTEM,
JSON_REGAL,
JSON_REGAL_LOGGING,
JSON_REGAL_LOGGING,
JSON_REGAL_LOGGING,
JSON_REGAL_LOGGING_ENABLE,
JSON_REGAL_LOGGING_ENABLE,
JSON_REGAL_LOGGING_ENABLE,
JSON_REGAL_LOGGING_ENABLE,
JSON_REGAL_LOGGING_ENABLE,
JSON_REGAL_LOGGING_ENABLE,
JSON_REGAL_LOGGING_ENABLE,
JSON_REGAL_LOGGING,
JSON_REGAL_LOGGING,
JSON_REGAL_LOGGING,
JSON_REGAL_LOGGING,
JSON_REGAL_LOGGING,
JSON_REGAL_LOGGING,
JSON_REGAL_LOGGING,
JSON_REGAL_LOGGING,
JSON_REGAL_LOGGING,
JSON_REGAL_LOGGING,
JSON_UNDEFINED
};
Parser::Parser()
: depth(0),
current(JSON_ROOT)
{
}
Parser::~Parser()
{
}
void
Parser::onPush(const string &name)
{
Internal("Regal::Json::Parser::onPush","name=",name);
switch (current)
{
case JSON_ROOT:
if (name=="regal" ) { current = JSON_REGAL; return; }
break;
case JSON_REGAL:
if (name=="config" ) { current = JSON_REGAL_CONFIG; return; }
if (name=="logging" ) { current = JSON_REGAL_LOGGING; return; }
break;
case JSON_REGAL_CONFIG:
if (name=="cache" ) { current = JSON_REGAL_CONFIG_CACHE; return; }
if (name=="configFile" ) { current = JSON_REGAL_CONFIG_CONFIGFILE; return; }
if (name=="dispatch" ) { current = JSON_REGAL_CONFIG_DISPATCH; return; }
if (name=="force" ) { current = JSON_REGAL_CONFIG_FORCE; return; }
if (name=="frame" ) { current = JSON_REGAL_CONFIG_FRAME; return; }
if (name=="system" ) { current = JSON_REGAL_CONFIG_SYSTEM; return; }
break;
case JSON_REGAL_CONFIG_CACHE:
if (name=="directory" ) { current = JSON_REGAL_CONFIG_CACHE_DIRECTORY; return; }
if (name=="enable" ) { current = JSON_REGAL_CONFIG_CACHE_ENABLE; return; }
if (name=="shader" ) { current = JSON_REGAL_CONFIG_CACHE_SHADER; return; }
if (name=="shaderRead" ) { current = JSON_REGAL_CONFIG_CACHE_SHADERREAD; return; }
if (name=="shaderWrite" ) { current = JSON_REGAL_CONFIG_CACHE_SHADERWRITE; return; }
if (name=="texture" ) { current = JSON_REGAL_CONFIG_CACHE_TEXTURE; return; }
if (name=="textureRead" ) { current = JSON_REGAL_CONFIG_CACHE_TEXTUREREAD; return; }
if (name=="textureWrite") { current = JSON_REGAL_CONFIG_CACHE_TEXTUREWRITE; return; }
break;
case JSON_REGAL_CONFIG_DISPATCH:
if (name=="emulation" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION; return; }
if (name=="enable" ) { current = JSON_REGAL_CONFIG_DISPATCH_ENABLE; return; }
if (name=="force" ) { current = JSON_REGAL_CONFIG_DISPATCH_FORCE; return; }
break;
case JSON_REGAL_CONFIG_DISPATCH_EMULATION:
if (name=="enable" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE; return; }
if (name=="force" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE; return; }
break;
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE:
if (name=="bin" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_BIN; return; }
if (name=="dsa" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_DSA; return; }
if (name=="filter" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_FILTER; return; }
if (name=="iff" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_IFF; return; }
if (name=="obj" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_OBJ; return; }
if (name=="ppa" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_PPA; return; }
if (name=="ppca" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_PPCA; return; }
if (name=="so" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_SO; return; }
if (name=="texc" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_TEXC; return; }
if (name=="vao" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_VAO; return; }
if (name=="xfer" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_XFER; return; }
break;
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE:
if (name=="bin" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_BIN; return; }
if (name=="dsa" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_DSA; return; }
if (name=="filter" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_FILTER; return; }
if (name=="iff" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_IFF; return; }
if (name=="obj" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_OBJ; return; }
if (name=="ppa" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_PPA; return; }
if (name=="ppca" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_PPCA; return; }
if (name=="so" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_SO; return; }
if (name=="texc" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_TEXC; return; }
if (name=="vao" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_VAO; return; }
if (name=="xfer" ) { current = JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_XFER; return; }
break;
case JSON_REGAL_CONFIG_DISPATCH_ENABLE:
if (name=="code" ) { current = JSON_REGAL_CONFIG_DISPATCH_ENABLE_CODE; return; }
if (name=="debug" ) { current = JSON_REGAL_CONFIG_DISPATCH_ENABLE_DEBUG; return; }
if (name=="driver" ) { current = JSON_REGAL_CONFIG_DISPATCH_ENABLE_DRIVER; return; }
if (name=="emulation" ) { current = JSON_REGAL_CONFIG_DISPATCH_ENABLE_EMULATION; return; }
if (name=="error" ) { current = JSON_REGAL_CONFIG_DISPATCH_ENABLE_ERROR; return; }
if (name=="log" ) { current = JSON_REGAL_CONFIG_DISPATCH_ENABLE_LOG; return; }
break;
case JSON_REGAL_CONFIG_DISPATCH_FORCE:
if (name=="emulation" ) { current = JSON_REGAL_CONFIG_DISPATCH_FORCE_EMULATION; return; }
break;
case JSON_REGAL_CONFIG_FORCE:
if (name=="Core" ) { current = JSON_REGAL_CONFIG_FORCE_CORE; return; }
if (name=="ES1" ) { current = JSON_REGAL_CONFIG_FORCE_ES1; return; }
if (name=="ES2" ) { current = JSON_REGAL_CONFIG_FORCE_ES2; return; }
break;
case JSON_REGAL_CONFIG_FRAME:
if (name=="limit" ) { current = JSON_REGAL_CONFIG_FRAME_LIMIT; return; }
if (name=="md5" ) { current = JSON_REGAL_CONFIG_FRAME_MD5; return; }
if (name=="save" ) { current = JSON_REGAL_CONFIG_FRAME_SAVE; return; }
break;
case JSON_REGAL_CONFIG_FRAME_MD5:
if (name=="color" ) { current = JSON_REGAL_CONFIG_FRAME_MD5_COLOR; return; }
if (name=="depth" ) { current = JSON_REGAL_CONFIG_FRAME_MD5_DEPTH; return; }
if (name=="mask" ) { current = JSON_REGAL_CONFIG_FRAME_MD5_MASK; return; }
if (name=="stencil" ) { current = JSON_REGAL_CONFIG_FRAME_MD5_STENCIL; return; }
break;
case JSON_REGAL_CONFIG_FRAME_MD5_MASK:
if (name=="color" ) { current = JSON_REGAL_CONFIG_FRAME_MD5_MASK_COLOR; return; }
if (name=="depth" ) { current = JSON_REGAL_CONFIG_FRAME_MD5_MASK_DEPTH; return; }
if (name=="stencil" ) { current = JSON_REGAL_CONFIG_FRAME_MD5_MASK_STENCIL; return; }
break;
case JSON_REGAL_CONFIG_FRAME_SAVE:
if (name=="color" ) { current = JSON_REGAL_CONFIG_FRAME_SAVE_COLOR; return; }
if (name=="depth" ) { current = JSON_REGAL_CONFIG_FRAME_SAVE_DEPTH; return; }
if (name=="stencil" ) { current = JSON_REGAL_CONFIG_FRAME_SAVE_STENCIL; return; }
break;
case JSON_REGAL_CONFIG_SYSTEM:
if (name=="EGL" ) { current = JSON_REGAL_CONFIG_SYSTEM_EGL; return; }
if (name=="ES1" ) { current = JSON_REGAL_CONFIG_SYSTEM_ES1; return; }
if (name=="ES2" ) { current = JSON_REGAL_CONFIG_SYSTEM_ES2; return; }
if (name=="GL" ) { current = JSON_REGAL_CONFIG_SYSTEM_GL; return; }
if (name=="GLX" ) { current = JSON_REGAL_CONFIG_SYSTEM_GLX; return; }
break;
case JSON_REGAL_LOGGING:
if (name=="bufferLimit" ) { current = JSON_REGAL_LOGGING_BUFFERLIMIT; return; }
if (name=="callback" ) { current = JSON_REGAL_LOGGING_CALLBACK; return; }
if (name=="enable" ) { current = JSON_REGAL_LOGGING_ENABLE; return; }
if (name=="filename" ) { current = JSON_REGAL_LOGGING_FILENAME; return; }
if (name=="frameTime" ) { current = JSON_REGAL_LOGGING_FRAMETIME; return; }
if (name=="json" ) { current = JSON_REGAL_LOGGING_JSON; return; }
if (name=="jsonFile" ) { current = JSON_REGAL_LOGGING_JSONFILE; return; }
if (name=="log" ) { current = JSON_REGAL_LOGGING_LOG; return; }
if (name=="maxBytes" ) { current = JSON_REGAL_LOGGING_MAXBYTES; return; }
if (name=="maxLines" ) { current = JSON_REGAL_LOGGING_MAXLINES; return; }
if (name=="once" ) { current = JSON_REGAL_LOGGING_ONCE; return; }
if (name=="pointers" ) { current = JSON_REGAL_LOGGING_POINTERS; return; }
if (name=="thread" ) { current = JSON_REGAL_LOGGING_THREAD; return; }
break;
case JSON_REGAL_LOGGING_ENABLE:
if (name=="app" ) { current = JSON_REGAL_LOGGING_ENABLE_APP; return; }
if (name=="driver" ) { current = JSON_REGAL_LOGGING_ENABLE_DRIVER; return; }
if (name=="error" ) { current = JSON_REGAL_LOGGING_ENABLE_ERROR; return; }
if (name=="http" ) { current = JSON_REGAL_LOGGING_ENABLE_HTTP; return; }
if (name=="info" ) { current = JSON_REGAL_LOGGING_ENABLE_INFO; return; }
if (name=="internal" ) { current = JSON_REGAL_LOGGING_ENABLE_INTERNAL; return; }
if (name=="warning" ) { current = JSON_REGAL_LOGGING_ENABLE_WARNING; return; }
break;
default:
break;
}
++depth;
}
void
Parser::onPop()
{
Internal("Regal::Json::Parser::onPop","()");
if (depth)
--depth;
else
current = parent[current];
}
void
Parser::onValue()
{
Internal("Regal::Json::Parser::onValue","NULL");
switch (current)
{
default:
Warning("Ignoring JSON value NULL");
break;
}
}
void
Parser::onValue(const bool value)
{
Internal("Regal::Json::Parser::onValue","value=",value);
switch (current)
{
case JSON_REGAL_CONFIG_CACHE_ENABLE : { set_json_regal_config_cache_enable(value); return; }
case JSON_REGAL_CONFIG_CACHE_SHADER : { set_json_regal_config_cache_shader(value); return; }
case JSON_REGAL_CONFIG_CACHE_SHADERREAD : { set_json_regal_config_cache_shaderread(value); return; }
case JSON_REGAL_CONFIG_CACHE_SHADERWRITE : { set_json_regal_config_cache_shaderwrite(value); return; }
case JSON_REGAL_CONFIG_CACHE_TEXTURE : { set_json_regal_config_cache_texture(value); return; }
case JSON_REGAL_CONFIG_CACHE_TEXTUREREAD : { set_json_regal_config_cache_textureread(value); return; }
case JSON_REGAL_CONFIG_CACHE_TEXTUREWRITE : { set_json_regal_config_cache_texturewrite(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_BIN : { set_json_regal_config_dispatch_emulation_enable_bin(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_DSA : { set_json_regal_config_dispatch_emulation_enable_dsa(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_FILTER: { set_json_regal_config_dispatch_emulation_enable_filter(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_IFF : { set_json_regal_config_dispatch_emulation_enable_iff(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_OBJ : { set_json_regal_config_dispatch_emulation_enable_obj(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_PPA : { set_json_regal_config_dispatch_emulation_enable_ppa(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_PPCA : { set_json_regal_config_dispatch_emulation_enable_ppca(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_SO : { set_json_regal_config_dispatch_emulation_enable_so(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_TEXC : { set_json_regal_config_dispatch_emulation_enable_texc(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_VAO : { set_json_regal_config_dispatch_emulation_enable_vao(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_XFER : { set_json_regal_config_dispatch_emulation_enable_xfer(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_BIN : { set_json_regal_config_dispatch_emulation_force_bin(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_DSA : { set_json_regal_config_dispatch_emulation_force_dsa(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_FILTER : { set_json_regal_config_dispatch_emulation_force_filter(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_IFF : { set_json_regal_config_dispatch_emulation_force_iff(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_OBJ : { set_json_regal_config_dispatch_emulation_force_obj(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_PPA : { set_json_regal_config_dispatch_emulation_force_ppa(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_PPCA : { set_json_regal_config_dispatch_emulation_force_ppca(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_SO : { set_json_regal_config_dispatch_emulation_force_so(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_TEXC : { set_json_regal_config_dispatch_emulation_force_texc(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_VAO : { set_json_regal_config_dispatch_emulation_force_vao(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_XFER : { set_json_regal_config_dispatch_emulation_force_xfer(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_ENABLE_CODE : { set_json_regal_config_dispatch_enable_code(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_ENABLE_DEBUG : { set_json_regal_config_dispatch_enable_debug(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_ENABLE_DRIVER : { set_json_regal_config_dispatch_enable_driver(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_ENABLE_EMULATION : { set_json_regal_config_dispatch_enable_emulation(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_ENABLE_ERROR : { set_json_regal_config_dispatch_enable_error(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_ENABLE_LOG : { set_json_regal_config_dispatch_enable_log(value); return; }
case JSON_REGAL_CONFIG_DISPATCH_FORCE_EMULATION : { set_json_regal_config_dispatch_force_emulation(value); return; }
case JSON_REGAL_CONFIG_FORCE_CORE : { set_json_regal_config_force_core(value); return; }
case JSON_REGAL_CONFIG_FORCE_ES1 : { set_json_regal_config_force_es1(value); return; }
case JSON_REGAL_CONFIG_FORCE_ES2 : { set_json_regal_config_force_es2(value); return; }
case JSON_REGAL_CONFIG_FRAME_MD5_COLOR : { set_json_regal_config_frame_md5_color(value); return; }
case JSON_REGAL_CONFIG_FRAME_MD5_DEPTH : { set_json_regal_config_frame_md5_depth(value); return; }
case JSON_REGAL_CONFIG_FRAME_MD5_STENCIL : { set_json_regal_config_frame_md5_stencil(value); return; }
case JSON_REGAL_CONFIG_FRAME_SAVE_COLOR : { set_json_regal_config_frame_save_color(value); return; }
case JSON_REGAL_CONFIG_FRAME_SAVE_DEPTH : { set_json_regal_config_frame_save_depth(value); return; }
case JSON_REGAL_CONFIG_FRAME_SAVE_STENCIL : { set_json_regal_config_frame_save_stencil(value); return; }
case JSON_REGAL_CONFIG_SYSTEM_EGL : { set_json_regal_config_system_egl(value); return; }
case JSON_REGAL_CONFIG_SYSTEM_ES1 : { set_json_regal_config_system_es1(value); return; }
case JSON_REGAL_CONFIG_SYSTEM_ES2 : { set_json_regal_config_system_es2(value); return; }
case JSON_REGAL_CONFIG_SYSTEM_GL : { set_json_regal_config_system_gl(value); return; }
case JSON_REGAL_CONFIG_SYSTEM_GLX : { set_json_regal_config_system_glx(value); return; }
case JSON_REGAL_LOGGING_CALLBACK : { set_json_regal_logging_callback(value); return; }
case JSON_REGAL_LOGGING_FRAMETIME : { set_json_regal_logging_frametime(value); return; }
case JSON_REGAL_LOGGING_JSON : { set_json_regal_logging_json(value); return; }
case JSON_REGAL_LOGGING_LOG : { set_json_regal_logging_log(value); return; }
case JSON_REGAL_LOGGING_ONCE : { set_json_regal_logging_once(value); return; }
case JSON_REGAL_LOGGING_POINTERS : { set_json_regal_logging_pointers(value); return; }
case JSON_REGAL_LOGGING_THREAD : { set_json_regal_logging_thread(value); return; }
case JSON_REGAL_LOGGING_ENABLE_APP : { set_json_regal_logging_enable_app(value); return; }
case JSON_REGAL_LOGGING_ENABLE_DRIVER : { set_json_regal_logging_enable_driver(value); return; }
case JSON_REGAL_LOGGING_ENABLE_ERROR : { set_json_regal_logging_enable_error(value); return; }
case JSON_REGAL_LOGGING_ENABLE_HTTP : { set_json_regal_logging_enable_http(value); return; }
case JSON_REGAL_LOGGING_ENABLE_INFO : { set_json_regal_logging_enable_info(value); return; }
case JSON_REGAL_LOGGING_ENABLE_INTERNAL : { set_json_regal_logging_enable_internal(value); return; }
case JSON_REGAL_LOGGING_ENABLE_WARNING : { set_json_regal_logging_enable_warning(value); return; }
default:
Warning("Ignoring JSON value: ",value);
break;
}
}
void
Parser::onValue(const long value)
{
Internal("Regal::Json::Parser::onValue","value=",value);
switch (current)
{
case JSON_REGAL_CONFIG_FRAME_LIMIT : { set_json_regal_config_frame_limit(value); return; }
case JSON_REGAL_CONFIG_FRAME_MD5_MASK_COLOR : { set_json_regal_config_frame_md5_mask_color(value); return; }
case JSON_REGAL_CONFIG_FRAME_MD5_MASK_DEPTH : { set_json_regal_config_frame_md5_mask_depth(value); return; }
case JSON_REGAL_CONFIG_FRAME_MD5_MASK_STENCIL : { set_json_regal_config_frame_md5_mask_stencil(value); return; }
case JSON_REGAL_LOGGING_BUFFERLIMIT : { set_json_regal_logging_bufferlimit(value); return; }
case JSON_REGAL_LOGGING_MAXBYTES : { set_json_regal_logging_maxbytes(value); return; }
case JSON_REGAL_LOGGING_MAXLINES : { set_json_regal_logging_maxlines(value); return; }
default:
Warning("Ignoring JSON value: ",value);
break;
}
}
void
Parser::onValue(const string &value)
{
Internal("Regal::Json::Parser::onValue","value=",value);
switch (current)
{
case JSON_REGAL_CONFIG_CONFIGFILE : { set_json_regal_config_configfile(value); return; }
case JSON_REGAL_CONFIG_CACHE_DIRECTORY : { set_json_regal_config_cache_directory(value); return; }
case JSON_REGAL_LOGGING_FILENAME : { set_json_regal_logging_filename(value); return; }
case JSON_REGAL_LOGGING_JSONFILE : { set_json_regal_logging_jsonfile(value); return; }
default:
Warning("Ignoring JSON value: ",value);
break;
}
}
////////////
static void
jsonslAction(jsonsl_t jsn, jsonsl_action_t action, struct jsonsl_state_st *state, const char *at)
{
Parser *parser = reinterpret_cast<Parser *>(jsn->data);
RegalAssert(parser);
UNUSED_PARAMETER(at);
switch (action)
{
case JSONSL_ACTION_PUSH:
break;
case JSONSL_ACTION_POP:
switch (state->type)
{
case JSONSL_T_HKEY:
parser->onPush(std::string(jsn->base+state->pos_begin+1,state->pos_cur-state->pos_begin-1));
return;
case JSONSL_T_OBJECT:
break;
case JSONSL_T_SPECIAL:
if (state->special_flags&JSONSL_SPECIALf_TRUE)
parser->onValue(true);
else if (state->special_flags&JSONSL_SPECIALf_FALSE)
parser->onValue(false);
else if (state->special_flags&JSONSL_SPECIALf_NUMERIC)
{
if (jsn->base[state->pos_begin]=='-')
parser->onValue(strtol(jsn->base+state->pos_begin,NULL,0));
else
parser->onValue((long)strtoul(jsn->base+state->pos_begin,NULL,0));
}
case JSONSL_T_STRING:
parser->onValue(std::string(jsn->base+state->pos_begin+1,state->pos_cur-state->pos_begin-1));
break;
default:
break;
}
parser->onPop();
break;
default:
break;
}
}
static int
jsonslError(jsonsl_t jsn, jsonsl_error_t err, struct jsonsl_state_st *state, char *at)
{
Parser *parser = reinterpret_cast<Parser *>(jsn->data);
RegalAssert(parser);
UNUSED_PARAMETER(parser);
UNUSED_PARAMETER(err);
UNUSED_PARAMETER(state);
UNUSED_PARAMETER(at);
Warning("JSON parsing error: ",jsonsl_strerror(err));
return 0; // zero to give up
}
bool
Parser::parseFile(const string &filename)
{
FILE *f = fopen(filename.c_str(), "rt");
if (!f)
return false;
jsonsl_t jsn = jsonsl_new(0x1000);
jsonsl_enable_all_callbacks(jsn);
jsn->action_callback = jsonslAction;
jsn->error_callback = jsonslError;
Parser parser;
jsn->data = &parser;
const size_t bufferSize = 4096;
char buffer[bufferSize];
for (;;)
{
size_t n = fread(buffer,1,bufferSize,f);
jsonsl_feed(jsn, buffer, n);
if (n<bufferSize)
break;
}
jsonsl_destroy(jsn);
fclose(f);
return true;
}
bool
Parser::parseString(const char *json)
{
jsonsl_t jsn = jsonsl_new(0x1000);
jsonsl_enable_all_callbacks(jsn);
jsn->action_callback = jsonslAction;
jsn->error_callback = jsonslError;
Parser parser;
jsn->data = &parser;
jsonsl_feed(jsn, json, strlen(json));
jsonsl_destroy(jsn);
return true;
}
}
REGAL_NAMESPACE_END

View file

@ -1,9 +1,6 @@
/*
Copyright (c) 2011-2013 NVIDIA Corporation
Copyright (c) 2011-2013 Cass Everitt
Copyright (c) 2012-2013 Scott Nations
Copyright (c) 2012 Mathias Schott
Copyright (c) 2012-2013 Nigel Stewart
Copyright (c) 2013 Nigel Stewart
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
@ -28,17 +25,10 @@
OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
Convenient JSON encoding
Nigel Stewart
*/
#ifndef __REGAL_JSON_H__
#define __REGAL_JSON_H__
// http://www.json.org/
#include "pch.h" /* For MS precompiled header support */
#include "RegalUtil.h"
@ -46,94 +36,139 @@ REGAL_GLOBAL_BEGIN
#include <string>
#include <boost/print/string_list.hpp>
REGAL_GLOBAL_END
REGAL_NAMESPACE_BEGIN
namespace Json
namespace Json {
enum Object
{
using ::std::string;
JSON_ROOT = 0,
using ::boost::print::string_list;
using ::boost::print::print_string;
using ::boost::print::pad;
JSON_REGAL,
JSON_REGAL_CONFIG,
JSON_REGAL_CONFIG_CACHE,
JSON_REGAL_CONFIG_CACHE_DIRECTORY,
JSON_REGAL_CONFIG_CACHE_ENABLE,
JSON_REGAL_CONFIG_CACHE_SHADER,
JSON_REGAL_CONFIG_CACHE_SHADERREAD,
JSON_REGAL_CONFIG_CACHE_SHADERWRITE,
JSON_REGAL_CONFIG_CACHE_TEXTURE,
JSON_REGAL_CONFIG_CACHE_TEXTUREREAD,
JSON_REGAL_CONFIG_CACHE_TEXTUREWRITE,
JSON_REGAL_CONFIG_CONFIGFILE,
JSON_REGAL_CONFIG_DISPATCH,
JSON_REGAL_CONFIG_DISPATCH_EMULATION,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_BIN,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_DSA,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_FILTER,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_IFF,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_OBJ,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_PPA,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_PPCA,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_SO,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_TEXC,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_VAO,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_ENABLE_XFER,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_BIN,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_DSA,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_FILTER,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_IFF,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_OBJ,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_PPA,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_PPCA,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_SO,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_TEXC,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_VAO,
JSON_REGAL_CONFIG_DISPATCH_EMULATION_FORCE_XFER,
JSON_REGAL_CONFIG_DISPATCH_ENABLE,
JSON_REGAL_CONFIG_DISPATCH_ENABLE_CODE,
JSON_REGAL_CONFIG_DISPATCH_ENABLE_DEBUG,
JSON_REGAL_CONFIG_DISPATCH_ENABLE_DRIVER,
JSON_REGAL_CONFIG_DISPATCH_ENABLE_EMULATION,
JSON_REGAL_CONFIG_DISPATCH_ENABLE_ERROR,
JSON_REGAL_CONFIG_DISPATCH_ENABLE_LOG,
JSON_REGAL_CONFIG_DISPATCH_FORCE,
JSON_REGAL_CONFIG_DISPATCH_FORCE_EMULATION,
JSON_REGAL_CONFIG_FORCE,
JSON_REGAL_CONFIG_FORCE_CORE,
JSON_REGAL_CONFIG_FORCE_ES1,
JSON_REGAL_CONFIG_FORCE_ES2,
JSON_REGAL_CONFIG_FRAME,
JSON_REGAL_CONFIG_FRAME_LIMIT,
JSON_REGAL_CONFIG_FRAME_MD5,
JSON_REGAL_CONFIG_FRAME_MD5_COLOR,
JSON_REGAL_CONFIG_FRAME_MD5_DEPTH,
JSON_REGAL_CONFIG_FRAME_MD5_MASK,
JSON_REGAL_CONFIG_FRAME_MD5_MASK_COLOR,
JSON_REGAL_CONFIG_FRAME_MD5_MASK_DEPTH,
JSON_REGAL_CONFIG_FRAME_MD5_MASK_STENCIL,
JSON_REGAL_CONFIG_FRAME_MD5_STENCIL,
JSON_REGAL_CONFIG_FRAME_SAVE,
JSON_REGAL_CONFIG_FRAME_SAVE_COLOR,
JSON_REGAL_CONFIG_FRAME_SAVE_DEPTH,
JSON_REGAL_CONFIG_FRAME_SAVE_STENCIL,
JSON_REGAL_CONFIG_SYSTEM,
JSON_REGAL_CONFIG_SYSTEM_EGL,
JSON_REGAL_CONFIG_SYSTEM_ES1,
JSON_REGAL_CONFIG_SYSTEM_ES2,
JSON_REGAL_CONFIG_SYSTEM_GL,
JSON_REGAL_CONFIG_SYSTEM_GLX,
JSON_REGAL_LOGGING,
JSON_REGAL_LOGGING_BUFFERLIMIT,
JSON_REGAL_LOGGING_CALLBACK,
JSON_REGAL_LOGGING_ENABLE,
JSON_REGAL_LOGGING_ENABLE_APP,
JSON_REGAL_LOGGING_ENABLE_DRIVER,
JSON_REGAL_LOGGING_ENABLE_ERROR,
JSON_REGAL_LOGGING_ENABLE_HTTP,
JSON_REGAL_LOGGING_ENABLE_INFO,
JSON_REGAL_LOGGING_ENABLE_INTERNAL,
JSON_REGAL_LOGGING_ENABLE_WARNING,
JSON_REGAL_LOGGING_FILENAME,
JSON_REGAL_LOGGING_FRAMETIME,
JSON_REGAL_LOGGING_JSON,
JSON_REGAL_LOGGING_JSONFILE,
JSON_REGAL_LOGGING_LOG,
JSON_REGAL_LOGGING_MAXBYTES,
JSON_REGAL_LOGGING_MAXLINES,
JSON_REGAL_LOGGING_ONCE,
JSON_REGAL_LOGGING_POINTERS,
JSON_REGAL_LOGGING_THREAD,
struct Output : public string_list< string >
{
public:
inline Output() : _empty(true), _nesting(0) {}
JSON_UNDEFINED
};
// Each nested object must be concluded with a call to end()
struct Parser
{
Parser();
~Parser();
inline void object(const char *name);
inline void object(const string &name);
void onPush(const std::string &name);
void onPop();
inline void member(const char *name); // name : null
inline void member(const char *name, const char *val); // name : "the text"
inline void member(const char *name, const string &val); // name : "the text"
void onValue();
void onValue(const bool value);
void onValue(const long value);
void onValue(const std::string &value);
template< typename T > void member(const char *name, const T &val);
//
inline void end();
static bool parseFile(const std::string &filename);
static bool parseString(const char *json);
private:
bool _empty;
size_t _nesting;
};
//
void Output::object(const char *name)
{
string tmp = print_string(_empty ? "\n" : ",\n", pad(_nesting), name, " {");
push_back_swap(tmp);
_empty = true;
_nesting++;
}
void Output::object(const string &name)
{
object(name.c_str());
}
void Output::end()
{
if (_nesting--)
{
string tmp = print_string("\n", pad(_nesting), "}");
push_back_swap(tmp);
}
}
void Output::member(const char *name)
{
string tmp = print_string(_empty ? "\n" : ",\n", pad(_nesting), name," : null");
push_back_swap(tmp);
_empty = false;
}
void Output::member(const char *name, const char *val)
{
string tmp = print_string(_empty ? "\n" : ",\n", pad(_nesting), name," : \"",val,"\"");
push_back_swap(tmp);
_empty = false;
}
void Output::member(const char *name, const string &val)
{
member(name,val.c_str());
}
template<typename T>
void Output::member(const char *name, const T &val)
{
string tmp = print_string(_empty ? "\n" : ",\n", pad(_nesting), name," : ",val);
push_back_swap(tmp);
_empty = false;
}
std::size_t depth;
Object current;
};
}
REGAL_NAMESPACE_END
#endif

75
src/regal/RegalJson.inl Normal file
View file

@ -0,0 +1,75 @@
#define set_json_regal_config_cache_directory(value) Config::cacheDirectory = value
#define set_json_regal_config_cache_enable(value) Config::cache = value
#define set_json_regal_config_cache_shader(value) Config::cacheShader = value
#define set_json_regal_config_cache_shaderread(value) Config::cacheShaderRead = value
#define set_json_regal_config_cache_shaderwrite(value) Config::cacheShaderWrite = value
#define set_json_regal_config_cache_texture(value) Config::cacheTexture = value
#define set_json_regal_config_cache_textureread(value) Config::cacheTextureRead = value
#define set_json_regal_config_cache_texturewrite(value) Config::cacheTextureWrite = value
#define set_json_regal_config_configfile(value) Config::configFile = value
#define set_json_regal_config_dispatch_emulation_enable_bin(value) Config::enableEmuBin = value
#define set_json_regal_config_dispatch_emulation_enable_dsa(value) Config::enableEmuDsa = value
#define set_json_regal_config_dispatch_emulation_enable_filter(value) Config::enableEmuFilter = value
#define set_json_regal_config_dispatch_emulation_enable_iff(value) Config::enableEmuIff = value
#define set_json_regal_config_dispatch_emulation_enable_obj(value) Config::enableEmuObj = value
#define set_json_regal_config_dispatch_emulation_enable_ppa(value) Config::enableEmuPpa = value
#define set_json_regal_config_dispatch_emulation_enable_ppca(value) Config::enableEmuPpca = value
#define set_json_regal_config_dispatch_emulation_enable_so(value) Config::enableEmuSo = value
#define set_json_regal_config_dispatch_emulation_enable_texc(value) Config::enableEmuTexC = value
#define set_json_regal_config_dispatch_emulation_enable_vao(value) Config::enableEmuVao = value
#define set_json_regal_config_dispatch_emulation_enable_xfer(value) Config::enableEmuXfer = value
#define set_json_regal_config_dispatch_emulation_force_bin(value) Config::forceEmuBin = value
#define set_json_regal_config_dispatch_emulation_force_dsa(value) Config::forceEmuDsa = value
#define set_json_regal_config_dispatch_emulation_force_filter(value) Config::forceEmuFilter = value
#define set_json_regal_config_dispatch_emulation_force_iff(value) Config::forceEmuIff = value
#define set_json_regal_config_dispatch_emulation_force_obj(value) Config::forceEmuObj = value
#define set_json_regal_config_dispatch_emulation_force_ppa(value) Config::forceEmuPpa = value
#define set_json_regal_config_dispatch_emulation_force_ppca(value) Config::forceEmuPpca = value
#define set_json_regal_config_dispatch_emulation_force_so(value) Config::forceEmuSo = value
#define set_json_regal_config_dispatch_emulation_force_texc(value) Config::forceEmuTexC = value
#define set_json_regal_config_dispatch_emulation_force_vao(value) Config::forceEmuVao = value
#define set_json_regal_config_dispatch_emulation_force_xfer(value) Config::forceEmuXfer = value
#define set_json_regal_config_dispatch_enable_code(value) Config::enableCode = value
#define set_json_regal_config_dispatch_enable_debug(value) Config::enableDebug = value
#define set_json_regal_config_dispatch_enable_driver(value) Config::enableDriver = value
#define set_json_regal_config_dispatch_enable_emulation(value) Config::enableEmulation = value
#define set_json_regal_config_dispatch_enable_error(value) Config::enableError = value
#define set_json_regal_config_dispatch_enable_log(value) Config::enableLog = value
#define set_json_regal_config_dispatch_force_emulation(value) Config::forceEmulation = value
#define set_json_regal_config_force_core(value) Config::forceCoreProfile = value
#define set_json_regal_config_force_es1(value) Config::forceES1Profile = value
#define set_json_regal_config_force_es2(value) Config::forceES2Profile = value
#define set_json_regal_config_frame_limit(value) Config::frameLimit = value
#define set_json_regal_config_frame_md5_color(value) Config::frameMd5Color = value
#define set_json_regal_config_frame_md5_depth(value) Config::frameMd5Depth = value
#define set_json_regal_config_frame_md5_mask_color(value) Config::frameMd5ColorMask = (unsigned char)(value)
#define set_json_regal_config_frame_md5_mask_depth(value) Config::frameMd5DepthMask = (size_t)(value)
#define set_json_regal_config_frame_md5_mask_stencil(value) Config::frameMd5StencilMask = (unsigned char)(value)
#define set_json_regal_config_frame_md5_stencil(value) Config::frameMd5Stencil = value
#define set_json_regal_config_frame_save_color(value) Config::frameSaveColor = value
#define set_json_regal_config_frame_save_depth(value) Config::frameSaveStencil = value
#define set_json_regal_config_frame_save_stencil(value) Config::frameSaveStencil = value
#define set_json_regal_config_system_egl(value) Config::sysEGL = value
#define set_json_regal_config_system_es1(value) Config::sysES1 = value
#define set_json_regal_config_system_es2(value) Config::sysES2 = value
#define set_json_regal_config_system_gl(value) Config::sysGL = value
#define set_json_regal_config_system_glx(value) Config::sysGLX = value
#define set_json_regal_logging_bufferlimit(value) Logging::bufferLimit = value
#define set_json_regal_logging_callback(value) Logging::callback = value
#define set_json_regal_logging_enable_app(value) Logging::enableApp = value
#define set_json_regal_logging_enable_driver(value) Logging::enableDriver = value
#define set_json_regal_logging_enable_error(value) Logging::enableError = value
#define set_json_regal_logging_enable_http(value) Logging::enableHttp = value
#define set_json_regal_logging_enable_info(value) Logging::enableInfo = value
#define set_json_regal_logging_enable_internal(value) Logging::enableInternal = value
#define set_json_regal_logging_enable_warning(value) Logging::enableError = value
#define set_json_regal_logging_filename(value) Logging::logFilename = value
#define set_json_regal_logging_frametime(value) Logging::frameTime = value
#define set_json_regal_logging_json(value) Logging::json = value
#define set_json_regal_logging_jsonfile(value) Logging::jsonFilename = value
#define set_json_regal_logging_log(value) Logging::log = value
#define set_json_regal_logging_maxbytes(value) Logging::maxBytes = value
#define set_json_regal_logging_maxlines(value) Logging::maxLines = value
#define set_json_regal_logging_once(value) Logging::once = value
#define set_json_regal_logging_pointers(value) Logging::pointers = value
#define set_json_regal_logging_thread(value) Logging::thread = value

View file

@ -109,8 +109,9 @@ namespace Logging {
bool initialized = false;
#if REGAL_LOG_ONCE
bool once = (REGAL_LOG_ONCE);
#if REGAL_LOG_ONCE
std::set<std::string> uniqueErrors;
std::set<std::string> uniqueWarnings;
#endif
@ -283,16 +284,19 @@ namespace Logging {
if (logOutput)
fileClose(&logOutput);
#if !REGAL_NO_JSON
if (jsonOutput)
{
fprintf(jsonOutput,"%s","{} ] }\n");
fileClose(&jsonOutput);
}
#endif
}
void
writeJSON(Json::Output &jo)
{
#if !REGAL_NO_JSON
jo.object("logging");
jo.object("enable");
@ -308,10 +312,7 @@ namespace Logging {
jo.member("maxLines", maxLines);
jo.member("maxBytes", maxBytes);
#if REGAL_LOG_ONCE
jo.member("once", once);
#endif
jo.member("frameTime", frameTime);
jo.member("pointers", pointers);
jo.member("thread", thread);
@ -324,6 +325,7 @@ namespace Logging {
jo.member("bufferLimit", bufferLimit);
jo.end();
#endif
}
inline size_t indent()
@ -372,6 +374,9 @@ namespace Logging {
inline string jsonObject(const char *prefix, const char *name, const string &str)
{
#if REGAL_NO_JSON
return string();
#else
//
// http://www.altdevblogaday.com/2012/08/21/using-chrometracing-to-view-your-inline-profiling-data/
//
@ -463,6 +468,7 @@ namespace Logging {
}
return jo.str();
#endif // REGAL_NO_JSON
}
// Append to the log buffer
@ -547,7 +553,7 @@ namespace Logging {
__android_log_write(ANDROID_LOG_INFO, REGAL_LOG_TAG, m.c_str());
#endif
#if REGAL_LOG_JSON
#if REGAL_LOG_JSON && !REGAL_NO_JSON
if (json && jsonOutput)
{
string m = jsonObject(prefix,name,str);

View file

@ -186,8 +186,9 @@ namespace Logging
extern bool pointers; // Enabled by default, otherwise empty
extern bool thread; // Disabled by default
#if REGAL_LOG_ONCE
extern bool once; // Warning and error message logged once only
#if REGAL_LOG_ONCE
extern std::set<std::string> uniqueErrors;
extern std::set<std::string> uniqueWarnings;
#endif

View file

@ -379,6 +379,10 @@
# define REGAL_NO_TLS 0
#endif
#ifndef REGAL_NO_JSON
# define REGAL_NO_JSON 0
#endif
// AssertFunction depends on Error log, but
// ideally we wouldn't depend on RegalLog.h here

View file

@ -32,8 +32,6 @@
#include <string>
#include "RegalHelper.h"
#include "RegalDispatch.h"
#include "RegalDispatchGMock.h"
using namespace std;
@ -47,8 +45,8 @@ TEST( RegalHelper, Get )
{
{
//
// $ egrep '^[ ]+case GL_[A-Z0-9_]*:.*size =' src/regal/RegalHelper.cpp \
// | grep -v sizeof | cut -b10-70 | gsed 's/:.*size =//' | gsed 's/;//' \
// $ egrep '^[ ]+case GL_[A-Z0-9_]*:.*size =' src/regal/RegalHelper.cpp
// | grep -v sizeof | cut -b10-70 | gsed 's/:.*size =//' | gsed 's/;//'
// | gsed 's/\([^ ]*\) \([^ ]*\)/ EXPECT_EQ(Regal::helper::size::get(\1),\2);/'
//

143
tests/testRegalJson.cpp Normal file
View file

@ -0,0 +1,143 @@
/*
Copyright (c) 2011-2013 NVIDIA Corporation
Copyright (c) 2013 Nigel Stewart
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "gtest/gtest.h"
#include <GL/Regal.h>
#include <string>
#include <algorithm>
#include <boost/print/json.hpp>
#include "RegalJson.h"
#include "RegalConfig.h"
#include "RegalLog.h"
namespace REGAL_NAMESPACE_INTERNAL { namespace Json { struct Output : public ::boost::print::json::output<std::string> {}; } }
using namespace std;
using namespace ::REGAL_NAMESPACE_INTERNAL;
namespace {
static string json()
{
Json::Output jo;
jo.object();
jo.object("regal");
Config::writeJSON(jo);
Logging::writeJSON(jo);
jo.end();
jo.end();
return jo.str();
}
// ====================================
// Regal::Json
// ====================================
TEST( RegalJson, Parser )
{
const string state0 = json();
EXPECT_GT(state0.length(),0);
EXPECT_NE(string::npos,state0.find("\"regal\""));
EXPECT_NE(string::npos,state0.find("\"config\""));
EXPECT_NE(string::npos,state0.find("\"logging\""));
// Toggle some Regal::Config state
Config::frameMd5Color = !Config::frameMd5Color;
const string state1 = json();
EXPECT_NE(state0,state1);
// Toggle it back again
Config::frameMd5Color = !Config::frameMd5Color;
const string state2 = json();
EXPECT_NE(state1,state2);
EXPECT_EQ(state0,state2);
// Increment an integer
Config::frameMd5DepthMask += 100;
const string state3 = json();
EXPECT_NE(state3,state0);
EXPECT_NE(state3,state1);
// Set a string
Config::cacheDirectory = "foo";
const string state4 = json();
EXPECT_NE(string::npos,state4.find("\"foo\""));
EXPECT_NE(state4,state0);
EXPECT_NE(state4,state1);
EXPECT_NE(state4,state3);
// Reset to state3
RegalConfigure(state3.c_str());
EXPECT_EQ(json(),state3);
// Reset to state1
RegalConfigure(state1.c_str());
EXPECT_EQ(state1,json());
// Reset to state0
RegalConfigure(state0.c_str());
EXPECT_EQ(state0,json());
}
TEST( RegalJson, Subset )
{
const string state0 = json();
const char *test1 = "{ \"regal\" : { \"config\" : { \"dispatch\" : { \"enable\" : { \"emulation\" : false }, \"force\" : { \"emulation\" : false } } } } }";
const char *test2 = "{ \"regal\" : { \"config\" : { \"dispatch\" : { \"enable\" : { \"emulation\" : true }, \"force\" : { \"emulation\" : true } } } } }";
RegalConfigure(test1);
EXPECT_EQ(Config::enableEmulation,false);
EXPECT_EQ(Config::forceEmulation,false);
RegalConfigure(test2);
EXPECT_EQ(Config::enableEmulation,true);
EXPECT_EQ(Config::forceEmulation,true);
// Reset to state0
RegalConfigure(state0.c_str());
EXPECT_EQ(state0,json());
}
}

2371
tests/testRegalToken.cpp Normal file

File diff suppressed because it is too large Load diff