Blame view

ios/cocos2d/cocos/editor-support/spine/Json.h 4.5 KB
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  /******************************************************************************
   * Spine Runtimes License Agreement
   * Last updated May 1, 2019. Replaces all prior versions.
   *
   * Copyright (c) 2013-2019, Esoteric Software LLC
   *
   * Integration of the Spine Runtimes into software or otherwise creating
   * derivative works of the Spine Runtimes is permitted under the terms and
   * conditions of Section 2 of the Spine Editor License Agreement:
   * http://esotericsoftware.com/spine-editor-license
   *
   * Otherwise, it is permitted to integrate the Spine Runtimes into software
   * or otherwise create derivative works of the Spine Runtimes (collectively,
   * "Products"), provided that each user of the Products must obtain their own
   * Spine Editor license and redistribution of the Products in any form must
   * include this license and copyright notice.
   *
   * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "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 ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT,
   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
   * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS
   * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) 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.
   *****************************************************************************/
  
  #ifndef Spine_Json_h
  #define Spine_Json_h
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
32
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
33
  #include <spine/SpineObject.h>
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
34
35
  
  #ifndef SPINE_JSON_HAVE_PREV
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
36
  /* spine doesn't use the "prev" link in the Json sibling lists. */
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
37
38
39
  #define SPINE_JSON_HAVE_PREV 0
  #endif
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
  namespace spine {
  class SP_API Json : public SpineObject {
  	friend class SkeletonJson;
  
  public:
  	/* Json Types: */
  	static const int JSON_FALSE;
  	static const int JSON_TRUE;
  	static const int JSON_NULL;
  	static const int JSON_NUMBER;
  	static const int JSON_STRING;
  	static const int JSON_ARRAY;
  	static const int JSON_OBJECT;
  
  	/* Get item "string" from object. Case insensitive. */
  	static Json *getItem(Json *object, const char *string);
  
  	static const char *getString(Json *object, const char *name, const char *defaultValue);
  
  	static float getFloat(Json *object, const char *name, float defaultValue);
  
  	static int getInt(Json *object, const char *name, int defaultValue);
  
  	static bool getBoolean(Json *object, const char *name, bool defaultValue);
  
  	/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when Json_create() returns 0. 0 when Json_create() succeeds. */
  	static const char *getError();
  
  	/* Supply a block of JSON, and this returns a Json object you can interrogate. Call Json_dispose when finished. */
  	explicit Json(const char *value);
  
  	~Json();
  
  
  
  private:
  	static const char *_error;
  
  	Json *_next;
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
79
  #if SPINE_JSON_HAVE_PREV
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
80
  	Json* _prev; /* next/prev allow you to walk array/object chains. Alternatively, use getSize/getItem */
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
81
  #endif
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
82
83
84
85
  	Json *_child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
  
  	int _type; /* The type of the item, as above. */
  	int _size; /* The number of children. */
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
86
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
87
88
89
  	const char *_valueString; /* The item's string, if type==JSON_STRING */
  	int _valueInt; /* The item's number, if type==JSON_NUMBER */
  	float _valueFloat; /* The item's number, if type==JSON_NUMBER */
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
90
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
91
  	const char *_name; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
92
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
93
94
  	/* Utility to jump whitespace and cr/lf */
  	static const char *skip(const char *inValue);
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
95
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
96
97
  	/* Parser core - when encountering text, process appropriately. */
  	static const char *parseValue(Json *item, const char *value);
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
98
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
99
100
  	/* Parse the input text into an unescaped cstring, and populate item. */
  	static const char *parseString(Json *item, const char *str);
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
101
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
102
103
  	/* Parse the input text to generate a number, and populate the result into item. */
  	static const char *parseNumber(Json *item, const char *num);
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
104
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
105
106
  	/* Build an array from input text. */
  	static const char *parseArray(Json *item, const char *value);
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
107
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
108
109
110
111
112
  	/* Build an object from the text. */
  	static const char *parseObject(Json *item, const char *value);
  
  	static int json_strcasecmp(const char *s1, const char *s2);
  };
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
113
  }
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
114
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
115
  #endif /* Spine_Json_h */