make Stream usable on non-sys targets
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
package kiss;
|
package kiss;
|
||||||
|
|
||||||
|
#if (sys || hxnodejs)
|
||||||
import sys.io.File;
|
import sys.io.File;
|
||||||
|
#end
|
||||||
import haxe.ds.Option;
|
import haxe.ds.Option;
|
||||||
|
|
||||||
using StringTools;
|
using StringTools;
|
||||||
@@ -42,9 +44,11 @@ class Stream {
|
|||||||
|
|
||||||
public var startOfLine = true;
|
public var startOfLine = true;
|
||||||
|
|
||||||
|
#if (sys || hxnodejs)
|
||||||
public static function fromFile(file:String) {
|
public static function fromFile(file:String) {
|
||||||
return new Stream(file, File.getContent(file));
|
return new Stream(file, File.getContent(file));
|
||||||
}
|
}
|
||||||
|
#end
|
||||||
|
|
||||||
public static function fromString(content:String) {
|
public static function fromString(content:String) {
|
||||||
return new Stream("string", content);
|
return new Stream("string", content);
|
||||||
|
Reference in New Issue
Block a user