DynamicExt
- pure haxeDynamicTools
- pure haxeJavaRandom
- pure haxeLambdaExt
- pure haxeSignalExt
- for msignalUrlLoaderExt
- for openflXmlExt
- pure haxeds.*
- pure haxe
haxelib git zame-miscutils https://github.com/restorer/zame-haxe-miscutils.git
Allow use Dynamic values like Map.
var node = new DynamicExt();
node["foo"] = "bar";
trace(node["foo"]);
trace(node.exists("foo"));
trace(node.exists("bar"));
node["bar"] = "baz";
trace(node.keys());
node.remove("foo");
trace(node.keys());
Along with DynamicExt allows to parse json in a safe manner.
import org.zamedev.lib.DynamicExt;
using org.zamedev.lib.DynamicTools;
var node : DynamicExt = haxe.Json.parse('{"a":{"b":"c"},"stringval":"haxe","arrayval":["haxe","cool"],"intval":42,"floatval":24.42,"boolval":true}');
trace(node["stringval"].asString());
trace(node["arrayval"].asArray());
trace(node["intval"].asInt());
trace(node["floatval"].asFloat());
trace(node["boolval"].asBool());
trace(node["nonexisting"].asString("defaultvalue"));
trace(node["nonexisting"].asNullInt());
trace(node["nonexisting"].asNullFloat());
trace(node["nonexisting"].asDynamic());
trace(node.byPath(["a", "b"]).asString()); // Returns "c"
Can be used as drop-in replacement of Lambda
when you need to work with an Iterator
(you should still use original Lambda
for an Iterable
).
var map = new Map<String, String>();
map["foo"] = "bar";
map["bar"] = "baz";
var result1 : Array<String> = map.keys().array();
trace(result1);
var result2 : Array<String> = map.keys().map(function(v) { return v.toUpperCase(); });
trace(result2);
Allows to get inner text from xml node in an easy way.
var root = Xml.parse("<root><node>inner value</node><node /></root>");
for (node in root.firstElement().elements()) {
trace(node.innerText("defaultvalue"));
}
Simplify work with json-based server API.
var loader = new UrlLoaderExt(function(loader : UrlLoaderExt) {
trace("success");
trace(loader.data);
}, function(_) {
trace("error happened");
});
loader.load(UrlLoaderExt.createJsonRequest("http://domain.tld", { foo:"bar" }));
This library is finished. Later I have plant to merge several smaller libraries into bigger one.
Feature | Support status |
---|---|
New features | No |
Non-critical bugfixes | No |
Critical bugfixes | Yes |
Pull requests | Accepted (after review) |
Issues | Monitored, but if you want to change something - submit a pull request |
OpenFL version planned to support | Up to 4.x, and probably later |
Estimated end-of-life | Up to 2017 (new library will be created later) |