<library name="UserData">
	<description>
		This library's API roughly matches the API of the FileIO library.
		Provides basic functions for interacting with the local user-persisted-and-sandboxed file system.
		Generally each platform provides a directory or some data store that is persisted just for the current user or app session.
		For Windows, this is the app's directory under %APPDATA%.
		For OSX and linux, this is the app's .-prefixed directory under ~/.
		For JavaScript, this library will create a virtual file system that is persisted over the localStorage object.
		All operations are virtualized and sandboxed over this directory, treating it as an empty file system.
	</description>
	<namespace name="UserData">
		
		<function name="pathJoin">
			<arg name="parts" type="list-of-string" description="strings to join"/>
			<description>Joins a list of strings with the platform's default path delimiter.</description>
		</function>

		<function name="pathExists">
			<arg name="path" type="string" description="an absolute or relative path"/>
			<returns type="bool" description="True if the path exists."/>
			<description>Checks to see if a path exists (either a file or a directory).</description>
		</function>

		<function name="fileExists">
			<arg name="path" type="string" description="an absolute or relative path"/>
			<returns type="bool" description="True if the path exists and is a file (not a directory)."/>
			<description>Checks to see if a file exists.</description>
		</function>

		<function name="directoryExists">
			<arg name="path" type="string" description="an absolute or relative path"/>
			<returns type="bool" description="True if the path exists and is a directory (not a file)."/>
			<description>Checks to see if a directory exists.</description>
		</function>

		<function name="getPathInfo">
			<arg name="path" type="string" description="an absolute or relative path"/>
			<returns type="FileIOCommon.FileDescriptor" description="File properties"/>
			<description>Returns a file descriptor.</description>
		</function>

		<function name="fileWriteText">
			<arg name="path" type="string" description="an absolute or relative path"/>
			<arg name="content" type="string" description="content to write to a file as a string"/>
			<arg name="encoding" type="FileIO.TextEncoding" description="encoding to use" optional="true" default="UTF8"/>
			<description>Writes text to a file</description>
		</function>

		<function name="fileReadText">
			<arg name="path" type="string" description="an absolute or relative path"/>
			<returns type="string" description="file contents as a string"/>
			<description>Returns the file contents as a string</description>
		</function>

		<function name="fileReadLines">
			<arg name="path" type="string" description="an absolute or relative path"/>
			<returns type="list-of-string" description="List of lines in the file"/>
			<description>Returns a list of lines in the file as a list of strings</description>
		</function>

		<function name="fileReadBytes">
			<arg name="path" type="string" description="an absolute or relative path"/>
			<returns type="list-of-int" description="List of bytes"/>
			<description>Returns a list of bytes in the file. These are unsigned numbers from 0 to 255.</description>
		</function>

		<function name="fileWriteBytes">
			<arg name="path" type="string" description="an absolute or relative path"/>
			<arg name="bytes" type="list-of-int" description="List of bytes"/>
			<description>Writes binary content to a file. Input must be a list of byte values that are either signed or unsigned.</description>
		</function>

		<function name="fileDelete">
			<arg name="path" type="string" description="an absolute or relative path"/>
			<description>Deletes a file from disk</description>
		</function>

		<function name="fileMove">
			<arg name="pathFrom" type="string" description="an absolute or relative path of the original file location"/>
			<arg name="pathTo" type="string" description="an absolute or relative path of the new file location"/>
			<arg name="allowOverwrite" type="bool" description="true if overwriting existing files is okay" optional="true" default="false"/>
			<description>Moves a file from one location to a new one. Optionally allows overwriting files.</description>
		</function>

		<function name="fileCopy">
			<arg name="pathFrom" type="string" description="an absolute or relative path of the original file location"/>
			<arg name="pathTo" type="string" description="an absolute or relative path of the new file location"/>
			<arg name="allowOverwrite" type="bool" description="true if overwriting existing files is okay" optional="true" default="false"/>
			<description>Copies a file to a new location. Optionally allows overwriting files.</description>
		</function>

		<function name="directoryList">
			<arg name="path" type="string" description="an absolute or relative path"/>
			<arg name="includeFullPath" type="bool" description="true if absolute file paths should be returned. Otherwise, file names only are returned." optional="true" default="false"/>
			<returns type="list-of-string" description="list of files"/>
			<description>Returns a list of files and subdirectories in a given directory</description>
		</function>

		<function name="directoryCreate">
			<arg name="path" type="string" description="an absolute or relative path to create"/>
			<arg name="makeParents" type="bool" description="true if parent directories should be created if already not present" optional="true" default="false"/>
			<description>Creates a new directory</description>
		</function>

		<function name="directoryDelete">
			<arg name="path" type="string" description="an absolute or relative path of a directory to delete"/>
			<description>Deletes a directory</description>
		</function>

		<function name="directoryMove">
			<arg name="pathFrom" type="string" description="an absolute or relative path of a directory to move"/>
			<arg name="pathTo" type="string" description="an absolute or relative path of a location to move a directory to"/>
			<description>Moves a directory and its contents to a new location.</description>
		</function>

		<function name="currentDirectory">
			<returns>Root of the virtualized file system.</returns>
			<description>Returns the root of the virtualized sandboxed file system. This is actually a hard coded string and returns a '/' every time.</description>
		</function>
	</namespace>
</library>