Răsfoiți Sursa

added getCDBContent()

Nicolas Cannasse 11 luni în urmă
părinte
comite
47d9d50e0d
1 a modificat fișierele cu 11 adăugiri și 0 ștergeri
  1. 11 0
      hide/Ide.hx

+ 11 - 0
hide/Ide.hx

@@ -741,6 +741,17 @@ class Ide extends hide.tools.IdeData {
 		js.Browser.location.reload();
 		js.Browser.location.reload();
 	}
 	}
 
 
+	public function getCDBContent<T>( sheetName : String ) : Array<T> {
+		for( s in database.sheets )
+			if( s.name == sheetName ) {
+				var s = Reflect.copy(@:privateAccess s.realSheet.sheet);
+				s.lines = [for( l in s.lines ) Reflect.copy(l)];
+				@:privateAccess cdb.Types.Index.initLines(s);
+				return cast s.lines;
+			}
+		return null;
+	}
+
 	public function getUnCachedUrl( path : String ) {
 	public function getUnCachedUrl( path : String ) {
 		return "file://" + getPath(path) + "?t=" + fileWatcher.getVersion(path);
 		return "file://" + getPath(path) + "?t=" + fileWatcher.getVersion(path);
 	}
 	}