@@ -49,3 +49,165 @@ bool Extension::IsTrue()
4949 }
5050 return false ;
5151}
52+
53+ bool Extension::ObjExists (TCHAR const *Name)
54+ {
55+ if (IsObject ())
56+ {
57+ std::string n = UTF8fromUnicode (Name);
58+ for (unsigned i = 0 ; i < current->u .object .length ; ++i)
59+ {
60+ if (current->u .object .values [i].name == n)
61+ {
62+ return true ;
63+ }
64+ }
65+ }
66+ return false ;
67+ }
68+
69+ bool Extension::IsObjString (TCHAR const *Name)
70+ {
71+ if (ObjExists (Name))
72+ {
73+ TempDelve td (*this , Name);
74+ return IsString ();
75+ }
76+ return false ;
77+ }
78+ bool Extension::IsObjInteger (TCHAR const *Name)
79+ {
80+ if (ObjExists (Name))
81+ {
82+ TempDelve td (*this , Name);
83+ return IsInteger ();
84+ }
85+ return false ;
86+ }
87+ bool Extension::IsObjDouble (TCHAR const *Name)
88+ {
89+ if (ObjExists (Name))
90+ {
91+ TempDelve td (*this , Name);
92+ return IsDouble ();
93+ }
94+ return false ;
95+ }
96+ bool Extension::IsObjObject (TCHAR const *Name)
97+ {
98+ if (ObjExists (Name))
99+ {
100+ TempDelve td (*this , Name);
101+ return IsObject ();
102+ }
103+ return false ;
104+ }
105+ bool Extension::IsObjArray (TCHAR const *Name)
106+ {
107+ if (ObjExists (Name))
108+ {
109+ TempDelve td (*this , Name);
110+ return IsArray ();
111+ }
112+ return false ;
113+ }
114+ bool Extension::IsObjBoolean (TCHAR const *Name)
115+ {
116+ if (ObjExists (Name))
117+ {
118+ TempDelve td (*this , Name);
119+ return IsBoolean ();
120+ }
121+ return false ;
122+ }
123+ bool Extension::IsObjNull (TCHAR const *Name)
124+ {
125+ if (ObjExists (Name))
126+ {
127+ TempDelve td (*this , Name);
128+ return IsNull ();
129+ }
130+ return false ;
131+ }
132+ bool Extension::IsObjTrue (TCHAR const *Name)
133+ {
134+ if (ObjExists (Name))
135+ {
136+ TempDelve td (*this , Name);
137+ return IsTrue ();
138+ }
139+ return false ;
140+ }
141+
142+ bool Extension::IsArrString (unsigned index)
143+ {
144+ if (IsArray () && index < current->u .array .length )
145+ {
146+ TempDelve td (*this , index);
147+ return IsString ();
148+ }
149+ return false ;
150+ }
151+ bool Extension::IsArrInteger (unsigned index)
152+ {
153+ if (IsArray () && index < current->u .array .length )
154+ {
155+ TempDelve td (*this , index);
156+ return IsInteger ();
157+ }
158+ return false ;
159+ }
160+ bool Extension::IsArrDouble (unsigned index)
161+ {
162+ if (IsArray () && index < current->u .array .length )
163+ {
164+ TempDelve td (*this , index);
165+ return IsDouble ();
166+ }
167+ return false ;
168+ }
169+ bool Extension::IsArrObject (unsigned index)
170+ {
171+ if (IsArray () && index < current->u .array .length )
172+ {
173+ TempDelve td (*this , index);
174+ return IsObject ();
175+ }
176+ return false ;
177+ }
178+ bool Extension::IsArrArray (unsigned index)
179+ {
180+ if (IsArray () && index < current->u .array .length )
181+ {
182+ TempDelve td (*this , index);
183+ return IsArray ();
184+ }
185+ return false ;
186+ }
187+ bool Extension::IsArrBoolean (unsigned index)
188+ {
189+ if (IsArray () && index < current->u .array .length )
190+ {
191+ TempDelve td (*this , index);
192+ return IsBoolean ();
193+ }
194+ return false ;
195+ }
196+ bool Extension::IsArrNull (unsigned index)
197+ {
198+ if (IsArray () && index < current->u .array .length )
199+ {
200+ TempDelve td (*this , index);
201+ return IsNull ();
202+ }
203+ return false ;
204+ }
205+ bool Extension::IsArrTrue (unsigned index)
206+ {
207+ if (IsArray () && index < current->u .array .length )
208+ {
209+ TempDelve td (*this , index);
210+ return IsTrue ();
211+ }
212+ return false ;
213+ }
0 commit comments