|
@@ -38,29 +38,16 @@ import haxe.io.BytesData;
|
|
|
}
|
|
|
|
|
|
public static function getString( name : String ) : String {
|
|
|
- #if embed_resources
|
|
|
- for (k in getContent().keys().iter()) {
|
|
|
- if (k == name) {
|
|
|
- var b : haxe.io.Bytes = haxe.crypto.Base64.decode(getContent().get(k, null));
|
|
|
- return b.toString();
|
|
|
- }
|
|
|
- }
|
|
|
+ var bytes = getBytes(name);
|
|
|
+ if (bytes != null)
|
|
|
+ return bytes.toString();
|
|
|
return null;
|
|
|
- #else
|
|
|
- return getContent().hasKey(name) ? Bytes.ofData(getContent().get(name, null)).toString() : null;
|
|
|
- #end
|
|
|
}
|
|
|
|
|
|
public static function getBytes( name : String ) : haxe.io.Bytes {
|
|
|
- #if embed_resources
|
|
|
- for( k in getContent().keys().iter() )
|
|
|
- if( k == name ) {
|
|
|
- var b : haxe.io.Bytes = haxe.crypto.Base64.decode(getContent().get(k, null));
|
|
|
- return b;
|
|
|
-
|
|
|
- }
|
|
|
- #else
|
|
|
- return Bytes.ofData(getContent().get(name,null));
|
|
|
- #end
|
|
|
+ var data = getContent().get(name, null);
|
|
|
+ if (data == null)
|
|
|
+ return null;
|
|
|
+ return Bytes.ofData(data);
|
|
|
}
|
|
|
}
|