D2BS
Public Member Functions | Static Public Member Functions

FileTools Class Reference

A collection of tools to do things like move files and determine whether files exist. More...

List of all members.

Public Member Functions

bool writeText (String file,...)
 Write the string representation (for standard files) or the binary representation (for binary files) of each of the arguments to the file.
bool appendText (String file,...)
 Append the string representation (for standard files) or the binary representation (for binary files) of each of the arguments to the file.

Static Public Member Functions

static void remove (String file)
 Remove (delete) a file.
static void rename (String orig, String newName)
 Rename a file.
static void copy (String orig, String newName)
 Copy a file.
static bool exists (String file)
 Determine if a file exists.
static String readText (String file)
 Read the contents of a file into a String.

Detailed Description

A collection of tools to do things like move files and determine whether files exist.


Member Function Documentation

bool FileTools::appendText ( String  file,
  ... 
)

Append the string representation (for standard files) or the binary representation (for binary files) of each of the arguments to the file.

Parameters:
fileThe filename of the file to write to.
Returns:
Whether or not the operation was successful.
static void FileTools::copy ( String  orig,
String  newName 
) [static]

Copy a file.

Parameters:
origThe original filename.
newNameThe filename of the new file.
static bool FileTools::exists ( String  file) [static]

Determine if a file exists.

Parameters:
fileThe filename of the file to check.
Returns:
Whether or not the file exists.
static String FileTools::readText ( String  file) [static]

Read the contents of a file into a String.

Parameters:
fileThe filename of the file to open.
Returns:
The contents of the file.
static void FileTools::remove ( String  file) [static]

Remove (delete) a file.

Parameters:
fileThe filename of the file to delete.
static void FileTools::rename ( String  orig,
String  newName 
) [static]

Rename a file.

Parameters:
origThe original filename.
newNameThe new filename.
bool FileTools::writeText ( String  file,
  ... 
)

Write the string representation (for standard files) or the binary representation (for binary files) of each of the arguments to the file.

Parameters:
fileThe filename of the file to write to.
Returns:
Whether or not the operation was successful.