/// <summary>Reads a user data file. (Standalone Application)</summary> public static void ReadFile_Standalone(string filePath, ReadFileCallback callback) { Debug.Assert(!string.IsNullOrEmpty(filePath)); Debug.Assert(callback != null); byte[] data = null; data = IOUtilities.LoadBinaryFile(filePath); callback.Invoke(true, data); }
/// <summary>Function for reading a user-specific file.</summary> public static void ReadFile(string filePathRelative, ReadFileCallback callback) { Debug.Assert(UserDataStorage.isInitialized); Debug.Assert(!string.IsNullOrEmpty(filePathRelative)); string filePath = IOUtilities.CombinePath(UserDataStorage.activeUserDirectory, filePathRelative); UserDataStorage.PLATFORM.ReadFile(filePath, callback); }
// --- File I/O --- /// <summary>Reads a file.</summary> public void ReadFile(string relativePath, ReadFileCallback callback) { Debug.Assert(!string.IsNullOrEmpty(relativePath)); Debug.Assert(callback != null); string path = IOUtilities.CombinePath(this.userDir, relativePath); byte[] data; bool success = this.ReadFile(path, out data); callback.Invoke(relativePath, success, data); }
/// <summary>Loads the user data file. (Facepunch.Steamworks)</summary> public static void ReadFile_Facepunch(string filePath, ReadFileCallback callback) { Debug.Assert(!string.IsNullOrEmpty(filePath)); Debug.Assert(callback != null); byte[] data = null; if (Steamworks.SteamRemoteStorage.FileExists(filePath)) { data = Steamworks.SteamRemoteStorage.FileRead(filePath); } callback.Invoke(true, data); }
// --- File I/O --- /// <summary>Reads a file.</summary> public void ReadFile(string relativePath, ReadFileCallback callback) { Debug.Assert(!string.IsNullOrEmpty(relativePath)); Debug.Assert(callback != null); string path = IOUtilities.CombinePath(this.userDir, relativePath); byte[] data = null; if (Steamworks.SteamRemoteStorage.FileExists(path)) { data = Steamworks.SteamRemoteStorage.FileRead(path); } callback.Invoke(relativePath, (data != null), data); }
/// <summary>Reads a user data file. (Steamworks.NET)</summary> public static void ReadFile_SteamworksNET(string filePath, ReadFileCallback callback) { Debug.Assert(!string.IsNullOrEmpty(filePath)); Debug.Assert(callback != null); byte[] data = null; if (Steamworks.SteamRemoteStorage.FileExists(filePath)) { int fileSize = Steamworks.SteamRemoteStorage.GetFileSize(filePath); if (fileSize > 0) { data = new byte[fileSize]; Steamworks.SteamRemoteStorage.FileRead(filePath, data, fileSize); } } callback.Invoke(true, data); }
// --- File I/O --- /// <summary>Reads a file.</summary> public void ReadFile(string relativePath, ReadFileCallback callback) { Debug.Assert(!string.IsNullOrEmpty(relativePath)); Debug.Assert(callback != null); string path = IOUtilities.CombinePath(this.UserDirectory, relativePath); byte[] data = null; if (Steamworks.SteamRemoteStorage.FileExists(path)) { int fileSize = Steamworks.SteamRemoteStorage.GetFileSize(path); if (fileSize > 0) { data = new byte[fileSize]; Steamworks.SteamRemoteStorage.FileRead(path, data, fileSize); } } callback.Invoke(relativePath, (data != null), data); }
/// <summary> /// Virilib.ReadFile((word) => /// { /// foreach (string x in word) Console.Write(x+" "); /// } /// , "config.txt"); /// </summary> /// <param name="rfc"></param> /// <param name="file"></param> public static bool ReadFile(string file, ReadFileCallback rfc) { if (!File.Exists(file)) { return(false); } string Line = ""; char[] sep = new char[] { ' ', '=', '\t' }; //sep[0] = ','; sep[1] = '='; sep[2] = ';'; sep[3] = ' '; sep[4] = '{'; sep[5] = '}'; sep[6] = ':'; //sep.Concat(Environment.NewLine.ToCharArray()); using (StreamReader Reader = new StreamReader(file)) { Line = "A"; while (Line != null) { Line = Reader.ReadLine(); if (Line != null) { if (Line != "") { if (Line[0] != '#') { List <string> something = Line.Split(sep, StringSplitOptions.RemoveEmptyEntries).ToList(); if (something[something.Count - 1] == "") { something.RemoveAt(something.Count - 1); } rfc(something); } } } } Reader.Close(); return(true); } }
public string CompileLegacyJson(string input, bool optimize, ReadFileCallback readCallback) { return(_native.compileJSONCallback(input, optimize, new AvdDLReadFileCallback(readCallback))); }
public string CompileLegacyJson(string input, bool optimize, ReadFileCallback readCallback) { return(_compileJsonCallback.Value(input, optimize, new NativeReadFileCallback(readCallback))); }
public string Compile(string input, ReadFileCallback readCallback) { return(_compileStandard.Value(input, new NativeReadFileCallback(readCallback))); }
public static extern string compileStandard(string _input, ReadFileCallback _readCallback);
public static extern void wkeOnReadFile(ReadFileCallback _callback);
public string Compile(string input, ReadFileCallback readCallback) { return(_native.compileStandard(input, new AvdDLReadFileCallback(readCallback))); }
// ------ File I/O ------ /// <summary>Reads a file.</summary> public static void ReadFile(string path, ReadFileCallback onComplete) { DataStorage.PLATFORM_IO.ReadFile(path, onComplete); }
public SourceFileResolver(string solSourceRoot, Dictionary <string, string> fileContents) { _solSourceRoot = solSourceRoot; _fileContents = fileContents ?? new Dictionary <string, string>(); ReadFileDelegate = ReadSolSourceFileManaged; }
public static extern string compileJSONCallback(string _input, bool _optimize, ReadFileCallback _readCallback);
static Proxy() { IsWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); Callback = CallBack; }
// ---------[ I/O Interface ]--------- /// <summary>Function for reading a user-specific file.</summary> public static void ReadFile(string relativePath, ReadFileCallback callback) { UserDataStorage.PLATFORM_IO.ReadFile(relativePath, callback); }
static extern int assetbundle_merge(ReadFileCallback callback, IntPtr userdata, string fromAssetbundle, string toAssetbundle, string diff);
static Proxy() { Platform = GetPlatform(); Callback = CallBack; }