Vuo  0.4.3
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Static Public Member Functions | List of all members
VuoFileUtilities Class Reference

Description

Functions for dealing with files.

Static Public Member Functions

static void splitPath (string path, string &dir, string &file, string &extension)
 Splits path into its directory, file name, and file extension.
 
static string makeTmpFile (string file, string extension, string directory="/tmp")
 Creates a new temporary file, avoiding any name conflicts with existing files.
 
static string makeTmpDir (string dir)
 Creates a new temporary directory, avoiding any name conflicts with existing files.
 
static FILE * stringToCFile (const char *string)
 Writes the contents of the input string to a C file.
 
static set< string > findFilesInDirectory (string dirPath)
 Searches a directory for files.
 
static set< string > findFilesInDirectory (string dirPath, string extension)
 Searches a directory for files with a given extension.
 
static bool fileExists (string path)
 Returns true if the file exists.
 

Member Function Documentation

set< string > VuoFileUtilities::findFilesInDirectory ( string  dirPath)
static

Searches a directory for files.

Parameters
dirPathThe directory to search in.
Returns
The paths of the found files. The paths are relative to dirPath.
set< string > VuoFileUtilities::findFilesInDirectory ( string  dirPath,
string  extension 
)
static

Searches a directory for files with a given extension.

Parameters
dirPathThe directory to search in.
extensionThe file extension to match on, without the '.' character (e.g. "bc" not ".bc").
Returns
The paths of the found files. The paths are relative to dirPath.
string VuoFileUtilities::makeTmpDir ( string  dir)
static

Creates a new temporary directory, avoiding any name conflicts with existing files.

Returns the path of the directory.

string VuoFileUtilities::makeTmpFile ( string  file,
string  extension,
string  directory = "/tmp" 
)
static

Creates a new temporary file, avoiding any name conflicts with existing files.

Creates the file in the specified directory if one is provided, or in "/tmp" otherwise.

Returns the path of the file.

void VuoFileUtilities::splitPath ( string  path,
string &  dir,
string &  file,
string &  extension 
)
static

Splits path into its directory, file name, and file extension.

Parameters
[in]pathThe path to split.
[out]dirThe directory in path, if any. Ends with a file separator (e.g. '/') if there was one in path.
[out]fileThe file name in path, if any.
[out]extensionThe file extension in path, if any. Does not include the '.' character.

The documentation for this class was generated from the following files: