14#ifndef OSGDB_FILEUTILS
15#define OSGDB_FILEUTILS 1
The osgDB library provides support for reading and writing scene graphs, providing a plugin framework...
Definition Archive:24
OSGDB_EXPORT DirectoryContents getSortedDirectoryContents(const std::string &dirName)
Return the contents of a directory, sorting the names into alphabetic and numberical order.
OSGDB_EXPORT CopyFileResult copyFile(const std::string &source, const std::string &destination)
Copy a file to another location, overwriting if necessary.
CopyFileResult
Definition FileUtils:88
@ COPY_FILE_SOURCE_NOT_OPENED
Error opening source file.
Definition FileUtils:93
@ COPY_FILE_OK
Operation done.
Definition FileUtils:89
@ COPY_FILE_SOURCE_MISSING
Source file doesn't exist.
Definition FileUtils:92
@ COPY_FILE_WRITE_ERROR
Definition FileUtils:96
@ COPY_FILE_DESTINATION_NOT_OPENED
Error opening destination file.
Definition FileUtils:94
@ COPY_FILE_READ_ERROR
Definition FileUtils:95
@ COPY_FILE_SOURCE_EQUALS_DESTINATION
Operation is useless (source == destination).
Definition FileUtils:90
@ COPY_FILE_BAD_ARGUMENT
Definition FileUtils:91
OSGDB_EXPORT std::string findLibraryFile(const std::string &filename, CaseSensitivity caseSensitivity=CASE_SENSITIVE)
OSGDB_EXPORT std::string findFileInPath(const std::string &filename, const FilePathList &filePath, CaseSensitivity caseSensitivity=CASE_SENSITIVE)
find specified file in specified file path.
std::vector< std::string > DirectoryContents
simple list of names to represent a directory's contents.
Definition FileUtils:67
OSGDB_EXPORT DirectoryContents expandWildcardsInFilename(const std::string &filename)
Return the list of filenames that match the given filename with wildcards.
OSGDB_EXPORT void convertStringPathIntoFilePathList(const std::string &paths, FilePathList &filepath)
convert a string containing a list of paths delimited either with ';' (Windows) or ':' (All other pla...
OSGDB_EXPORT DirectoryContents getDirectoryContents(const std::string &dirName)
Return the contents of a directory.
std::deque< std::string > FilePathList
list of directories to search through which searching for files.
Definition Callbacks:28
OSGDB_EXPORT void appendPlatformSpecificResourceFilePaths(FilePathList &filepath)
void setDataFilePathList(const FilePathList &filepath)
Definition FileUtils:107
OSGDB_EXPORT std::string findFileInDirectory(const std::string &fileName, const std::string &dirName, CaseSensitivity caseSensitivity=CASE_SENSITIVE)
return the directory/filename of a file if its is contained within specified directory.
FileType
Definition FileUtils:47
@ FILE_NOT_FOUND
Definition FileUtils:48
@ REGULAR_FILE
Definition FileUtils:49
@ DIRECTORY
Definition FileUtils:50
OSGDB_EXPORT FILE * fopen(const char *filename, const char *mode)
Overload of the standard fopen function.
OSGDB_EXPORT bool fileExists(const std::string &filename)
return true if a file exists.
OSGDB_EXPORT bool makeDirectoryForFile(const std::string &filePath)
Make a new directory for a given file.
void setLibraryFilePathList(const FilePathList &filepaths)
Definition FileUtils:123
OSGDB_EXPORT bool makeDirectory(const std::string &directoryPath)
Make a new directory.
OSGDB_EXPORT std::string findDataFile(const std::string &filename, CaseSensitivity caseSensitivity=CASE_SENSITIVE)
Search for specified file in file system, checking the DataFilePathList for possible paths,...
FilePathList & getLibraryFilePathList()
Definition FileUtils:127
CaseSensitivity
Definition Callbacks:31
@ CASE_SENSITIVE
Definition Callbacks:32
OSGDB_EXPORT FileType fileType(const std::string &filename)
return type of file.
OSGDB_EXPORT void appendPlatformSpecificLibraryFilePaths(FilePathList &filepath)
OSGDB_EXPORT bool setCurrentWorkingDirectory(const std::string &newCurrentWorkingDirectory)
Set current working directory.
FilePathList & getDataFilePathList()
Definition FileUtils:111
OSGDB_EXPORT bool containsCurrentWorkingDirectoryReference(const FilePathList &paths)
Return true if FilePathList contains a filepath that is significies checking of the current working d...
OSGDB_EXPORT std::string getCurrentWorkingDirectory(void)
Get current working directory.
Options base class used for passing options into plugins to control their operation.
Definition Options:30
FilePathList & getLibraryFilePathList()
get the library file path which is used when search for library (dso/dll's) files.
Definition Registry:423
void setDataFilePathList(const FilePathList &filepath)
Set the data file path using a list of paths stored in a FilePath, which is used when search for data...
Definition Registry:401
FilePathList & getDataFilePathList()
get the data file path which is used when search for data files.
Definition Registry:407
static Registry * instance(bool erase=false)
void setLibraryFilePathList(const FilePathList &filepath)
Set the library file path using a list of paths stored in a FilePath, which is used when search for d...
Definition Registry:417
#define OSGDB_EXPORT
Definition Export:39