# FileUtils File Reference

`#include <osgDB/Registry>`
`#include <vector>`
`#include <deque>`
`#include <string>`

Include dependency graph for FileUtils:

This graph shows which files directly or indirectly include this file:

## Namespaces

namespace | osgDB

## Defines

#define | OSGDB_FILEUTILS 1

## Typedefs

typedef std::vector< std::string > | DirectoryContents
| simple list of names to represent a directory's contents.

## Enumerations

enum | CaseSensitivity { CASE_SENSITIVE, CASE_INSENSITIVE }
enum | FileType { FILE_NOT_FOUND, REGULAR_FILE, DIRECTORY }

## Functions

OSGDB_EXPORT bool | makeDirectory (const std::string &directoryPath)
OSGDB_EXPORT bool | makeDirectoryForFile (const std::string &filePath)
OSGDB_EXPORT bool | fileExists (const std::string &filename)
| return true if a file exisits.
OSGDB_EXPORT FileType | fileType (const std::string &filename)
| return type of file.
OSGDB_EXPORT std::string | findFileInPath (const std::string &filename, const FilePathList &filePath, CaseSensitivity caseSensitivity=CASE_SENSITIVE)
| find specified file in specified file path.
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.
OSGDB_EXPORT DirectoryContents | getDirectoryContents (const std::string &dirName)
| return the contents of a directory.
void | setDataFilePathList (const FilePathList &filepath)
void | setDataFilePathList (const std::string &paths)
FilePathList & | getDataFilePathList ()
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, returning the full path of the first valid file found, return an empty string if no string is found.
OSGDB_EXPORT std::string | findDataFile (const std::string &filename, const ReaderWriter::Options *options, CaseSensitivity caseSensitivity=CASE_SENSITIVE)
| Search for specified file in file system, checking first the database path set in the Options structure, then the DataFilePathList for possible paths, returning the full path of the first valid file found, return an empty string if no string is found.
void | setLibraryFilePathList (const FilePathList &filepaths)
void | setLibraryFilePathList (const std::string &paths)
FilePathList & | getLibraryFilePathList ()
OSGDB_EXPORT std::string | findLibraryFile (const std::string &filename, CaseSensitivity caseSensitivity=CASE_SENSITIVE)
OSGDB_EXPORT void | convertStringPathIntoFilePathList (const std::string &paths, FilePathList &filepath)
| convert a string containing a list of paths deliminated either with ';' (Windows) or ':' (All other platforms) into FilePath represetation.
OSGDB_EXPORT void | appendPlatformSpecificLibraryFilePaths (FilePathList &filepath)

## Define Documentation

#define OSGDB_FILEUTILS 1

## Typedef Documentation

typedef std::vector<std::string> osgDB::DirectoryContents

| simple list of names to represent a directory's contents.

## Enumeration Type Documentation

enum osgDB::CaseSensitivity

Enumeration values:

  CASE_SENSITIVE |
  CASE_INSENSITIVE |

enum osgDB::FileType

Enumeration values:

  FILE_NOT_FOUND |
  REGULAR_FILE |
  DIRECTORY |

## Function Documentation

void osgDB::appendPlatformSpecificLibraryFilePaths | ( | FilePathList & | filepath | ) |

void osgDB::convertStringPathIntoFilePathList | ( | const std::string & | paths,
|  | FilePathList & | filepath
| ) |

| convert a string containing a list of paths deliminated either with ';' (Windows) or ':' (All other platforms) into FilePath represetation.

bool OSGA_Archive::fileExists | ( | const std::string & | filename | ) |

| return true if a file exisits.

osgDB::FileType osgDB::fileType | ( | const std::string & | filename | ) |

| return type of file.

OSGDB_EXPORT std::string osgDB::findDataFile | ( | const std::string & | filename,
|  | const ReaderWriter::Options * | options,
|  | CaseSensitivity | caseSensitivity = `CASE_SENSITIVE`
| ) |

| Search for specified file in file system, checking first the database path set in the Options structure, then the DataFilePathList for possible paths, returning the full path of the first valid file found, return an empty string if no string is found.

std::string osgDB::findDataFile | ( | const std::string & | filename,
|  | CaseSensitivity | caseSensitivity = `CASE_SENSITIVE`
| ) |

| Search for specified file in file system, checking the DataFilePathList for possible paths, returning the full path of the first valid file found, return an empty string if no string is found.

std::string osgDB::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. return "" if directory does not contain file. If caseInsensitive is set to true then a case insensitive comparison is used to compare fileName to directory contents. This is useful when unix programs attempt read case insentive windows filenames.

std::string osgDB::findFileInPath | ( | const std::string & | filename,
|  | const FilePathList & | filePath,
|  | CaseSensitivity | caseSensitivity = `CASE_SENSITIVE`
| ) |

| find specified file in specified file path.

std::string osgDB::findLibraryFile | ( | const std::string & | filename,
|  | CaseSensitivity | caseSensitivity = `CASE_SENSITIVE`
| ) |

FilePathList& getDataFilePathList | ( |  | ) | `[inline]`

osgDB::DirectoryContents osgDB::getDirectoryContents | ( | const std::string & | dirName | ) |

| return the contents of a directory. returns an empty array on any error.

FilePathList& getLibraryFilePathList | ( |  | ) | `[inline]`

bool osgDB::makeDirectory | ( | const std::string & | directoryPath | ) |

bool osgDB::makeDirectoryForFile | ( | const std::string & | filePath | ) |

void Registry::setDataFilePathList | ( | const std::string & | paths | ) | `[inline]`

void setDataFilePathList | ( | const FilePathList & | filepath | ) | `[inline]`

void Registry::setLibraryFilePathList | ( | const std::string & | paths | ) | `[inline]`

void setLibraryFilePathList | ( | const FilePathList & | filepaths | ) | `[inline]`