diff options
author | Sven Gothel <[email protected]> | 2015-03-21 23:01:12 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-03-21 23:01:12 +0100 |
commit | 0c5c4be020c2d55540058a49b2a879f46d5a1e13 (patch) | |
tree | 00f84c2ca18cc233b826014094b9cad0769a3ea5 /LibOVR/Src/OVR_JSON.h | |
parent | cbbd775b6c754927632c333ff01424a0d2048c7c (diff) | |
parent | e490c3c7f7bb5461cfa78a214827aa534fb43a3e (diff) |
Merge branch 'vanilla_0.4.4' and resolve conflicts
TODO: Validate for removed patches due to relocation
Resolved Conflicts:
LibOVR/Src/Kernel/OVR_ThreadsWinAPI.cpp
LibOVR/Src/OVR_Linux_HMDDevice.cpp
LibOVR/Src/OVR_OSX_HMDDevice.cpp
LibOVR/Src/OVR_Profile.cpp
LibOVR/Src/OVR_Sensor2Impl.cpp
LibOVR/Src/OVR_SensorFusion.cpp
LibOVR/Src/OVR_SensorImpl.cpp
LibOVR/Src/OVR_Win32_DeviceStatus.cpp
LibOVR/Src/OVR_Win32_HIDDevice.cpp
LibOVR/Src/OVR_Win32_HIDDevice.h
LibOVR/Src/OVR_Win32_HMDDevice.cpp
Diffstat (limited to 'LibOVR/Src/OVR_JSON.h')
-rw-r--r-- | LibOVR/Src/OVR_JSON.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/LibOVR/Src/OVR_JSON.h b/LibOVR/Src/OVR_JSON.h index a2a603c..488cb1d 100644 --- a/LibOVR/Src/OVR_JSON.h +++ b/LibOVR/Src/OVR_JSON.h @@ -7,16 +7,16 @@ Created : April 9, 2013 Author : Brant Lewis Notes : -Copyright : Copyright 2014 Oculus VR, Inc. All Rights reserved. +Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved. -Licensed under the Oculus VR Rift SDK License Version 3.1 (the "License"); +Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License"); you may not use the Oculus VR Rift SDK except in compliance with the License, which is provided at the time of installation or download, or which otherwise accompanies this software in either electronic or hard copy form. You may obtain a copy of the License at -http://www.oculusvr.com/licenses/LICENSE-3.1 +http://www.oculusvr.com/licenses/LICENSE-3.2 Unless required by applicable law or agreed to in writing, the Oculus VR SDK distributed under the License is distributed on an "AS IS" BASIS, @@ -71,12 +71,13 @@ public: // *** Creation of NEW JSON objects - static JSON* CreateObject() { return new JSON(JSON_Object);} - static JSON* CreateNull() { return new JSON(JSON_Null); } - static JSON* CreateArray() { return new JSON(JSON_Array); } - static JSON* CreateBool(bool b) { return createHelper(JSON_Bool, b ? 1.0 : 0.0); } - static JSON* CreateNumber(double num) { return createHelper(JSON_Number, num); } - static JSON* CreateString(const char *s) { return createHelper(JSON_String, 0.0, s); } + static JSON* CreateObject() { return new JSON(JSON_Object);} + static JSON* CreateNull() { return new JSON(JSON_Null); } + static JSON* CreateArray() { return new JSON(JSON_Array); } + static JSON* CreateBool(bool b); + static JSON* CreateNumber(double num); + static JSON* CreateInt(int num); + static JSON* CreateString(const char *s); // Creates a new JSON object from parsing string. // Returns null pointer and fills in *perror in case of parse error. @@ -120,6 +121,7 @@ public: void AddItem(const char *string, JSON* item); void AddNullItem(const char* name) { AddItem(name, CreateNull()); } void AddBoolItem(const char* name, bool b) { AddItem(name, CreateBool(b)); } + void AddIntItem(const char* name, int n) { AddItem(name, CreateInt(n)); } void AddNumberItem(const char* name, double n) { AddItem(name, CreateNumber(n)); } void AddStringItem(const char* name, const char* s) { AddItem(name, CreateString(s)); } // void ReplaceItem(unsigned index, JSON* new_item); @@ -132,6 +134,7 @@ public: void AddArrayElement(JSON *item); void InsertArrayElement(int index, JSON* item); void AddArrayNumber(double n) { AddArrayElement(CreateNumber(n)); } + void AddArrayInt(int n) { AddArrayElement(CreateInt(n)); } void AddArrayString(const char* s) { AddArrayElement(CreateString(s)); } // Accessed array elements; currently inefficient. @@ -144,8 +147,6 @@ public: protected: JSON(JSONItemType itemType = JSON_Object); - static JSON* createHelper(JSONItemType itemType, double dval, const char* strVal = 0); - // JSON Parsing helper functions. const char* parseValue(const char *buff, const char** perror); const char* parseNumber(const char *num); |