The agxIO namespace contains classes for reading, writing and finding files.
static AGXCORE_EXPORT bool mkdir(const agx::String &path, bool recursive=false)
Creates a directory on the host file system.
static AGXCORE_EXPORT bool rename(const agx::String &oldPath, const agx::String &newPath)
static AGXCORE_EXPORT agx::String mkTmpDirectory(const agx::String &parentDirectory, const agx::String &prefix)
static AGXCORE_EXPORT bool scan(const agx::String &path, ScanCallback callback)
static AGXCORE_EXPORT const char * DLL_SUFFIX
Filetype for dynamically loaded libraries (dll / so / dylib)
static AGXCORE_EXPORT agx::String getFileWithoutExtension(const agx::String &filePath)
static AGXCORE_EXPORT bool isLink(const agx::String &path)
static AGXCORE_EXPORT agx::String getTmpFilename()
static AGXCORE_EXPORT bool closeFile(FILE *stream)
Close the FILE* stream.
static AGXCORE_EXPORT agx::String mkTmpDirectory(const agx::String &prefix="")
Create a temporary directory.
static AGXCORE_EXPORT agx::String convertWindowsFilePathToUnix(const agx::String &windowsStyle)
static AGXCORE_EXPORT FILE * openFile(const char *file, const char *mode)
Open a file.
static AGXCORE_EXPORT time_t compareDate(const agx::String &path1, const agx::String &path2)
static AGXCORE_EXPORT bool copy(const agx::String &source, const agx::String &destination)
static AGXCORE_EXPORT agx::String convertToColladaFilePath(const agx::String &filePath)
Take a filepath, convert it to Unix format (using UNIX_PATH_SEPARATOR) and finally convert it to a fo...
static AGXCORE_EXPORT agx::String getDirectory(const agx::String &filePath)
agx::Callback1< const agx::String & > ScanCallback
Scan a directory.
static agx::String AGXCORE_EXPORT getAbsolutePath(const agx::String &relativePath)
If is a relative path (isabsolute() returns false), the path will be expanded into a full path using ...
static AGXCORE_EXPORT bool isDir(const agx::String &path)
Test if a path is a directory.
static AGXCORE_EXPORT int stat(const agx::String &path, StatStruct *buf)
Wrapper around the stat-function to work around a bug in Visual Studio when passing an empty string t...
static AGXCORE_EXPORT bool writeable(const agx::String &path)
Test if a path exists and is writeable.
static AGXCORE_EXPORT agx::String getFileExtension(const agx::String &filePath)
static AGXCORE_EXPORT bool readable(const agx::String &path)
Test if a path exists and is readable.
static agx::String AGXCORE_EXPORT getPath(const agx::String &path)
\ return the path without any ending filename (only the directory/disk) in native format
static AGXCORE_EXPORT agx::String getFileWithExtension(const agx::String &filePath)
static AGXCORE_EXPORT const char * PATH_DELIMITER
Separator between paths in a list of paths, on unix: ":", on windows ";".
static agx::String AGXCORE_EXPORT getCurrentWorkingDirectory()
static AGXCORE_EXPORT bool isAbsolute(const agx::String &path)
static AGXCORE_EXPORT agx::String getSystemTmpDirectory()
static AGXCORE_EXPORT const char * PATH_SEPARATOR
Separator between directories in a file path: on unix "/", on windows "\\".
static AGXCORE_EXPORT agx::String combinePath(const agx::String &path1, const agx::String &path2)
Combine two paths with a separator.
static AGXCORE_EXPORT size_t getFilesInDirectory(agx::StringVector &result, const agx::String &path, bool recursive=false)
Returns a list of all files in a directory.
static AGXCORE_EXPORT bool exists(const agx::String &path)
Test if a path exists.
static AGXCORE_EXPORT agx::String readFile(const agx::String &filename)
Read the contents of filename and return it as a String.
static AGXCORE_EXPORT const char * UNIX_PATH_SEPARATOR
Path separator under UNIX "/".
static AGXCORE_EXPORT size_t size(const agx::String &path)
/return The size of the file.
static AGXCORE_EXPORT FILE * openFile(const agx::String &str, const char *mode)
Open a file.
static AGXCORE_EXPORT agx::String convertToNativeFilePath(const agx::String &filePath)
static AGXCORE_EXPORT agx::String convertUnixFilePathToWindows(const agx::String &unixStyle)
static AGXCORE_EXPORT bool remove(const agx::String &path, bool recursive=false)
static bool AGXCORE_EXPORT setCurrentWorkingDirectory(const agx::String &path)
Set the current working directory.
static AGXCORE_EXPORT const char * WINDOWS_PATH_SEPARATOR
Path separator under Windows "\\".