#include <file_utilities.h>
|
static MAXON_METHOD Result< void > | ReadFileToMemory (UrlOrInputStream &&name, WritableArrayInterface< Char > &arr) |
|
static MAXON_METHOD Result< void > | ReadUtfFile (UrlOrInputStream &&url, WritableArrayInterface< Utf32Char > &arr, UTFTEXT_OPTIONS::TEXTENCODING defaultDecoding=UTFTEXT_OPTIONS::TEXTENCODING::UTF8) |
|
static MAXON_METHOD Result< void > | WriteUtfFile (const Url &url, const ArrayInterface< Utf32Char > &arr, UTFTEXT_OPTIONS::TEXTENCODING encoding=UTFTEXT_OPTIONS::TEXTENCODING::UTF8, Bool dontWriteHeader=false) |
|
static MAXON_METHOD Result< void > | CompareFiles (UrlOrInputStream &&file1, UrlOrInputStream &&file2) |
|
template<typename T > |
static Result< void > | ReadToArray (UrlOrInputStream &&url, BaseArray< T > &dest) |
|
static MAXON_METHOD Result< void > | CopyStream (const InputStreamRef &from, const OutputStreamRef &to) |
|
static MAXON_METHOD Result< void > | CopyStreamProgress (const InputStreamRef &from, const OutputStreamRef &to, const IoProgressDelegate &progress) |
|
static MAXON_METHOD Result< void > | CopyFileOrDirectory (const Url &from, const Url &to) |
|
static MAXON_METHOD Result< void > | CopyFileOrDirectory (const Url &from, const String &to, const WriteArchiveRef &archive) |
|
static MAXON_METHOD Result< void > | WriteDirectoryTree (const Url &root, UrlOrOutputStream &&out, const WriteDirectoryFilterDelegate &filterDelegate) |
|
static MAXON_METHOD Result< Bool > | ReadDirectoryTree (UrlOrInputStream &&in, const ReadDirectoryTreeReceiver &receiver) |
|
static MAXON_METHOD Result< OutputStreamRef > | CreateCStringOutputStream (CString &str, Int maxLength=LIMIT< Int >::MAX) |
|
static MAXON_METHOD Result< OutputStreamRef > | CreateNullOutputStream () |
|
static MAXON_METHOD Result< void > | WriteArray (UrlOrOutputStream &&out, const Block< Char > &buffer) |
|
static MAXON_METHOD Result< void > | WriteString (UrlOrOutputStream &&out, const String &string, const StringEncodingRef &encoding=GetUtf8DefaultEncoder()) |
|
static MAXON_METHOD Result< String > | ReadString (UrlOrInputStream &&in, const StringDecodingRef &decoding=GetUtf8DefaultDecoder()) |
|
◆ WriteDirectoryFilterDelegate
return true to add file to index, false to ignore in index
◆ ReadDirectoryTreeReceiver
◆ MAXON_INTERFACE_NONVIRTUAL()
◆ ReadFileToMemory()
Reads a file into memory.
- Parameters
-
[in] | name | Name or Stream of the file. |
[out] | arr | Array holding the memory, will be initialized inside. |
- Returns
- OK on success.
◆ ReadUtfFile()
Reads a file into memory. If an UTF encoding is detected the proper decoding takes place.
- Parameters
-
[in] | url | Name or Stream of the file. |
[out] | arr | Array holding the memory, will be initialized inside. |
[in] | defaultDecoding | The character decoding that will be used if the file does not contain any Byte Order Mark (BOM). |
- Returns
- OK on success.
◆ WriteUtfFile()
Writes a Utf32Char array from memory to disc in a UTF-encoded format.
- Parameters
-
[in] | url | The file to be written. |
[in] | arr | Array holding the data. |
[in] | encoding | The character encoding to be used. |
[in] | dontWriteHeader | If true the utf8 header will not be written. |
- Returns
- OK on success.
◆ CompareFiles()
Compares the content of 2 files for binary equality.
- Parameters
-
[in] | file1 | Name or Stream of the file 1. |
[in] | file2 | Name or Stream of the file 2. |
- Returns
- Success and result of the comparison. If the files don't match or cannot be read an error is returned.
◆ ReadToArray()
Reads stream directly into an array
- Parameters
-
[in] | url | path to stream |
[out] | dest | BaseArray where the data is stored |
◆ CopyStream()
static MAXON_METHOD Result<void> CopyStream |
( |
const InputStreamRef & |
from, |
|
|
const OutputStreamRef & |
to |
|
) |
| |
|
static |
Copies all bytes from from to #to. This function reads bytes as long as possible. It doesn't call the Close() method on from or #to.
- Parameters
-
[in] | from | The stream from which the bytes shall be read. |
[in] | to | The stream to which the bytes shall be written. |
- Returns
- Success of operation.
◆ CopyStreamProgress()
Copies all bytes from from to #to. This function reads bytes as long as possible. It doesn't call the Close() method on from or #to.
- Parameters
-
[in] | from | The stream from which the bytes shall be read. |
[in] | to | The stream to which the bytes shall be written. |
[in] | progress | Progress delegate which is called to notify about the progress. |
- Returns
- Success of operation.
◆ CopyFileOrDirectory() [1/2]
Copies the file or directory from to #to. If it doesn't already exist, a file or directory is created for the Url #to. For a file its content is copied, for a directory a recursive copy happens. Symbolic links are skipped.
- Parameters
-
[in] | from | The source Url. |
[in] | to | The destination Url. |
- Returns
- Success of operation.
◆ CopyFileOrDirectory() [2/2]
Copies the file or directory from into an archive #archive/#to. If it doesn't already exist, a file or directory is created for the Url #to. For a file its content is copied, for a directory a recursive copy happens. Symbolic links are skipped.
- Parameters
-
[in] | from | The source Url. |
[in] | to | The relative destination Url in the archive. |
[in] | archive | Archive to write to. |
- Returns
- Success of operation.
◆ WriteDirectoryTree()
◆ ReadDirectoryTree()
◆ CreateCStringOutputStream()
Creates an output stream which writes to the given CString. Whenever bytes are written to the stream, these will be appended to str.
- Parameters
-
[out] | str | The string to write to. You have to keep the object alive as long as the stream is in use. Previously existing content of str is kept. |
[in] | maxLength | The maximum length of the string. When this limit is exceeded, no further characters will be appended. |
- Returns
- New output stream.
◆ CreateNullOutputStream()
Creates an output stream which just discards any bytes written to it without reporting errors (similar to the null device of operating systems, e.g.
{/dev/null}).
- Returns
- New output stream.
◆ WriteArray()
◆ WriteString()
◆ ReadString()