Browse Source

added safe check. added readData

Nicolas Cannasse 19 years ago
parent
commit
60560e847a
1 changed files with 6 additions and 0 deletions
  1. 6 0
      std/tools/haxelib/Datas.hx

+ 6 - 0
std/tools/haxelib/Datas.hx

@@ -63,6 +63,8 @@ class Datas {
 	}
 
 	public static function safe( name : String ) {
+		if( !alphanum.match(name) )
+			throw "Invalid parameter : "+name;
 		return name.split(".").join(",");
 	}
 
@@ -83,7 +85,11 @@ class Datas {
 			}
 		if( xmldata == null )
 			throw XML+" not found in package";
+		return readData(xmldata);
 
+	}
+
+	public static function readData( xmldata : String ) : XmlInfos {
 		var sname = Att("name",FReg(alphanum));
 		var schema = RNode(
 			"project",