}
};
+public class FileSize64 : uint64
+{
+ int OnCompare(FileSize64 data2)
+ {
+ int result = 0;
+ if(&this && &data2)
+ {
+ if(this > data2)
+ result = 1;
+ else if(this < data2)
+ result = -1;
+ }
+ return result;
+ }
+
+ char * OnGetString(char * string, void * fieldData, bool * needClass)
+ {
+ PrintBigSize(string, this, 2);
+ return string;
+ }
+
+ bool OnGetDataFromString(char * string)
+ {
+ char * end;
+ double value = strtod(string, &end);
+ uint64 multiplier = 1;
+ if(strstr(end, "PB") || strstr(end, "pb")) multiplier = (uint64)1024 * 1024 * 1024 * 1024;
+ else if(strstr(end, "TB") || strstr(end, "tb")) multiplier = (uint64)1024 * 1024 * 1024 * 1024;
+ else if(strstr(end, "GB") || strstr(end, "gb")) multiplier = (uint64)1024 * 1024 * 1024;
+ else if(strstr(end, "MB") || strstr(end, "mb")) multiplier = (uint64)1024 * 1024;
+ else if(strstr(end, "KB") || strstr(end, "kb")) multiplier = 1024;
+
+ this = (uint64)(multiplier * value);
+ return true;
+ }
+};
+
class FileSystem
{
virtual File ::Open(char * archive, char * name, FileOpenMode mode);
typedef unsigned short uint16;
typedef unsigned int uint;
typedef unsigned long long uint64;
+typedef uint64 FileSize64;
#define false 0
#define true 1
return result;
}
-void System_GetFreeSpace(char * path, FileSize * size)
+void System_GetFreeSpace(char * path, FileSize64 * size)
{
uint64 freeSize = 0;
#ifdef __WIN32__
GetDiskFreeSpaceEx(_wpath, (PULARGE_INTEGER)&freeSize, null, null);
__ecereNameSpace__ecere__com__eSystem_Delete(_wpath);
#endif
- *size = (FileSize)freeSize;
+ *size = (FileSize64)freeSize;
}
void System_UnsetEnvironment(char * envName);
bool System_Execute(char * env, char * command, va_list args);
bool System_ShellOpen(char * fileName, va_list args);
-void System_GetFreeSpace(char * path, FileSize * size);
+void System_GetFreeSpace(char * path, FileSize64 * size);
private:
return result;
}
-public void GetFreeSpace(char * path, FileSize * size)
+public void GetFreeSpace(char * path, FileSize64 * size)
{
System_GetFreeSpace(path, size);
}