Skip to content

Commit cc096cc

Browse files
(v2) Create v2 source folder.
1 parent 15b70f7 commit cc096cc

File tree

5,535 files changed

+935204
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,535 files changed

+935204
-1
lines changed

source/phasereditor/phasereditor.help/phaser-editor-toc.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
</topic>
88

99
<topic label="What&apos;s New">
10-
<topic href="html/whats-new/What&apos;s new in v1.4.4.html" label="What&apos;s new in Phaser Editor v1.4.4">
10+
<topic label="Topic">
11+
</topic>
12+
<topic href="html/whats-new/What&apos;s new in v1.5.0.html" label="What&apos;s new in Phaser Editor v1.5.0">
1113
</topic>
1214
<topic href="html/whats-new/What&apos;s new in v1.4.3.html" label="What&apos;s new in Phaser Editor v1.4.3">
1315
</topic>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
4+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5+
<classpathentry kind="src" path="src">
6+
<attributes>
7+
<attribute name="ignore_optional_problems" value="true"/>
8+
</attributes>
9+
</classpathentry>
10+
<classpathentry kind="output" path="bin"/>
11+
</classpath>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>org.json</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.pde.ManifestBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.pde.SchemaBuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
</buildSpec>
24+
<natures>
25+
<nature>org.eclipse.pde.PluginNature</nature>
26+
<nature>org.eclipse.jdt.core.javanature</nature>
27+
</natures>
28+
</projectDescription>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4+
org.eclipse.jdt.core.compiler.compliance=1.8
5+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7+
org.eclipse.jdt.core.compiler.source=1.8
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-Name: JSON (Modified)
4+
Bundle-SymbolicName: org.json
5+
Bundle-Version: 1.4.0.20170412
6+
Bundle-Vendor: org.json (boniatillo.com modfications)
7+
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
8+
Export-Package: com.boniatillo.json,
9+
org.json
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source.. = src/
2+
output.. = bin/
3+
bin.includes = META-INF/,\
4+
.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
// The MIT License (MIT)
2+
//
3+
// Copyright (c) 2015 Arian Fornaris
4+
//
5+
// Permission is hereby granted, free of charge, to any person obtaining a
6+
// copy of this software and associated documentation files (the
7+
// "Software"), to deal in the Software without restriction, including
8+
// without limitation the rights to use, copy, modify, merge, publish,
9+
// distribute, sublicense, and/or sell copies of the Software, and to permit
10+
// persons to whom the Software is furnished to do so, subject to the
11+
// following conditions: The above copyright notice and this permission
12+
// notice shall be included in all copies or substantial portions of the
13+
// Software.
14+
//
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
18+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
19+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
package com.boniatillo.json;
23+
24+
import java.lang.reflect.Array;
25+
import java.util.ArrayList;
26+
import java.util.Iterator;
27+
import java.util.List;
28+
import java.util.function.Function;
29+
30+
import org.json.JSONArray;
31+
import org.json.JSONObject;
32+
33+
public class JSONUtils {
34+
public static <T> T[] toArray(Class<T> cls, JSONArray jsonArray) {
35+
T[] array = (T[]) Array.newInstance(cls, jsonArray.length());
36+
for (int i = 0; i < array.length; i++) {
37+
array[i] = (T) jsonArray.get(i);
38+
}
39+
return array;
40+
}
41+
42+
public static <T> List<T> toList(JSONArray array) {
43+
List<T> list = new ArrayList<>();
44+
for (int i = 0; i < array.length(); i++) {
45+
list.add((T) array.get(i));
46+
}
47+
return list;
48+
}
49+
50+
public static <T> Iterable<T> iter(JSONArray array, Function<Integer, T> get) {
51+
return new Iterable<T>() {
52+
53+
@Override
54+
public Iterator<T> iterator() {
55+
return new Iterator<T>() {
56+
Integer i = 0;
57+
58+
@Override
59+
public T next() {
60+
T e = get.apply(i);
61+
return e;
62+
}
63+
64+
@Override
65+
public boolean hasNext() {
66+
return i < array.length();
67+
}
68+
};
69+
}
70+
};
71+
}
72+
73+
public static Iterable<JSONObject> iterObj(JSONArray array) {
74+
return new Iterable<JSONObject>() {
75+
76+
@Override
77+
public Iterator<JSONObject> iterator() {
78+
return new Iterator<JSONObject>() {
79+
int i = 0;
80+
81+
@Override
82+
public JSONObject next() {
83+
return array.getJSONObject(i++);
84+
}
85+
86+
@Override
87+
public boolean hasNext() {
88+
return i < array.length();
89+
}
90+
};
91+
}
92+
};
93+
}
94+
}

0 commit comments

Comments
 (0)