43 {
44 string fileContent;
45
48
49 string makeDataError;
50 if (!
MakeData(data, fileContent, makeDataError,
true))
51 {
52 errorMessage = string.Format("Cannot save data to file \"%1\", %2", filename, makeDataError);
53 return false;
54 }
55
57 if (handle == 0)
58 {
59 errorMessage = string.Format("Cannot open file \"%1\" for writing", filename);
60 return false;
61 }
62
63 FPrint(handle, fileContent);
65
66 return true;
67 }
static bool MakeData(T inputData, out string outputData, out string errorMessage, bool prettyPrint=true)
static ref JsonSerializer m_Serializer
proto void CloseFile(FileHandle file)
Close the File.
proto void FPrint(FileHandle file, void var)
Write to file.
proto FileHandle OpenFile(string name, FileMode mode)
Opens File.