/*
	A lot of these methods consume an arbitrary object called diskRef. This can be
	any object you wish to construct in the platform that is capable of supporting these 
	operations (or no object if you just want to operate against the native disk). For example
	JavaScript can create a fully virtualized file system since there is no disk to work with
	or even a virtualized file system based on the loccalStorage dictionary (which is what UserData 
	uses to "write files to the user's app data directory").
*/

int _lib_fileiocommon_getDirParent(
	string path,
	Array<string> stringOut);

// Get the root of this path, such as "C:" or "~"
string _lib_fileiocommon_getDirRoot(
	string path);

bool _lib_fileiocommon_directoryExists(
	object diskRef,
	string path);

int _lib_fileiocommon_directoryCreate(
	object diskRef,
	string path);

int _lib_fileiocommon_directoryDelete(
	object diskRef,
	string path);

int _lib_fileiocommon_directoryList(
	object diskRef,
	string directoryPath,
	bool includeFullPathOtherwiseIncludeJustFilenames,
	List<string> outputList);

int _lib_fileiocommon_directoryMove(
	object diskRef,
	string pathFrom,
	string pathTo);

int _lib_fileiocommon_fileDelete(
	object diskRef,
	string wellFormedPath);

int _lib_fileiocommon_fileMove(
	object diskRef,
	string wellFormedPathFrom,
	string wellFormedPathTo,
	bool trueForCopyFalseForMove,
	bool allowOverwrite);

// returns status
int _lib_fileiocommon_fileRead(
	object diskRef,
	string wellFormedSandboxedPath,
	bool readDataAsBytes,
	Array<string> stringOut,
	Array<Value> integers,
	List<Value> outputListForBytes);

// only one of the last two params are set
int _lib_fileiocommon_fileWrite(
	object diskRef,
	string wellFormedSandboxedPath,
	int formatEnum, // 0 -> raw bytes, 1 -> UTF8, 2 -> UTF8 w/ BOM, 3 -> ISO-8859
	string textOrNull,
	object byteArrayOrNull);

// returns absolute path of where the host things the current directory is
string _lib_fileiocommon_getCurrentDirectory();

void _lib_fileiocommon_getFileInfo(
	object diskRef, 
	string wellFormedSandboxedPath, 
	int propertiesBitMask, 
	Array<int> intOutParams, 
	Array<double> floatOutParams);

// Returns the user directory e.g. "C:\Users\Blake" or "~"
string _lib_fileiocommon_getUserDirectory();

// initializes a virtualized disk object. no-ops in non-JS
object _lib_fileiocommon_initializeDisk(
	bool useLocalStorage);

bool _lib_fileiocommon_isWindows();

// returns argument 2
List<string> _lib_fileiocommon_textToLines(string originalText, List<string> outputList);
