About
The class maxon::FileUtilities provides several functions to easily access the content of a given file.
Utilities
These functions automatically read the content of a file or stream into the given memory. The memory (typically a maxon::BaseArray) is automatically resized.
const maxon::InputStreamRef inputStream = url.OpenInputStream()
iferr_return;
{
}
{
}
Definition: basearray.h:412
static MAXON_METHOD Result< void > ReadFileToMemory(UrlOrInputStream &&name, WritableArrayInterface< Char > &arr)
static Result< void > ReadToArray(UrlOrInputStream &&url, BaseArray< T > &dest)
Definition: file_utilities.h:138
Definition: string.h:1235
#define MAXON_SCOPE
Definition: apibase.h:2841
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:176
#define iferr_return
Definition: resultbase.h:1519
maxon::FileUtilities::ReadFileToMemory() can be used to retrieve the answer from a web server using POST parameters.
maxon::Url theServer {
"http://localhost:8080"_s };
Definition: string.h:1490
PyObject PyObject * result
Definition: abstract.h:43
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:210
#define iferr(...)
Definition: errorbase.h:388
These functions handle the file's data as maxon::Utf32Char text:
See also Stream Conversions Manual.
The size and content of two files or streams is easily compared with:
{
}
static MAXON_METHOD Result< void > CompareFiles(UrlOrInputStream &&file1, UrlOrInputStream &&file2)
Py_UCS4 * res
Definition: unicodeobject.h:1113
static const ERROR_FAILED FAILED
Definition: resultbase.h:68
Further Reading