FileSystem.hpp File Reference

#include "blocxx/BLOCXX_config.h"
#include "blocxx/Types.hpp"
#include "blocxx/ArrayFwd.hpp"
#include "blocxx/Exception.hpp"
#include "blocxx/CommonFwd.hpp"
#include "blocxx/String.hpp"
#include <utility>
#include <sys/param.h>

Go to the source code of this file.

Namespaces

namespace  BLOCXX_NAMESPACE
namespace  BLOCXX_NAMESPACE::FileSystem
namespace  BLOCXX_NAMESPACE::FileSystem::Path

Classes

class  BLOCXX_NAMESPACE::FileSystemException
struct  BLOCXX_NAMESPACE::FileSystem::NullFactory

Defines

#define MAXPATHLEN   1024

Enumerations

enum  BLOCXX_NAMESPACE::FileSystem::Path::ESecurity { BLOCXX_NAMESPACE::FileSystem::Path::E_INSECURE, BLOCXX_NAMESPACE::FileSystem::Path::E_SECURE_DIR, BLOCXX_NAMESPACE::FileSystem::Path::E_SECURE_FILE }

Functions

File BLOCXX_NAMESPACE::FileSystem::openFile (const String &path)
 Open a file for read/write and return an File object that can be used for reading and writing.
File BLOCXX_NAMESPACE::FileSystem::createFile (const String &path)
 Create the file for the given name.
File BLOCXX_NAMESPACE::FileSystem::openOrCreateFile (const String &path)
 Opens or creates the file for the given name.
File BLOCXX_NAMESPACE::FileSystem::openForAppendOrCreateFile (const String &path)
 Opens the file for the given name to append data or create if it does not exist.
File BLOCXX_NAMESPACE::FileSystem::createAutoDeleteTempFile (const String &dir=String())
 Create a tempororary file that will be removed when the returned File object is closed.
File BLOCXX_NAMESPACE::FileSystem::createTempFile (String &filePath, const String &dir=String())
 Create a tempororary file in an optional directory.
int BLOCXX_NAMESPACE::FileSystem::changeFileOwner (const String &filename, const UserId &userId)
 Change the given file ownership.
bool BLOCXX_NAMESPACE::FileSystem::exists (const String &path)
bool BLOCXX_NAMESPACE::FileSystem::isExecutable (const String &path)
 Tests if a file is executable.
bool BLOCXX_NAMESPACE::FileSystem::canRead (const String &path)
bool BLOCXX_NAMESPACE::FileSystem::canWrite (const String &path)
bool BLOCXX_NAMESPACE::FileSystem::isLink (const String &path)
 Tests if a file is a symbolic link.
bool BLOCXX_NAMESPACE::FileSystem::isDirectory (const String &path)
bool BLOCXX_NAMESPACE::FileSystem::changeDirectory (const String &path)
 Change to the given directory.
bool BLOCXX_NAMESPACE::FileSystem::makeDirectory (const String &path, int mode=0777)
 Create a directory.
bool BLOCXX_NAMESPACE::FileSystem::getFileSize (const String &path, Int64 &size)
 Get the size of the file in bytes.
UInt64 BLOCXX_NAMESPACE::FileSystem::fileSize (FileHandle fh)
 Get the size of a file from the file handle.
bool BLOCXX_NAMESPACE::FileSystem::removeDirectory (const String &path)
 Remove the given directory.
bool BLOCXX_NAMESPACE::FileSystem::removeFile (const String &path)
 Remove the given file.
bool BLOCXX_NAMESPACE::FileSystem::getDirectoryContents (const String &path, StringArray &dirEntries)
 Get the names of the files (and directories) in the given directory.
bool BLOCXX_NAMESPACE::FileSystem::renameFile (const String &oldFileName, const String &newFileName)
 Rename the given file to the new name.
size_t BLOCXX_NAMESPACE::FileSystem::read (const FileHandle &hdl, void *bfr, size_t numberOfBytes, Int64 offset=-1L)
 Read data from file.
size_t BLOCXX_NAMESPACE::FileSystem::write (FileHandle hdl, const void *bfr, size_t numberOfBytes, Int64 offset=-1L)
 Write data to a file.
Int64 BLOCXX_NAMESPACE::FileSystem::seek (const FileHandle &hdl, Int64 offset, int whence)
 Seek to a given offset within the file.
Int64 BLOCXX_NAMESPACE::FileSystem::tell (const FileHandle &hdl)
void BLOCXX_NAMESPACE::FileSystem::rewind (const FileHandle &hdl)
 Position the file pointer associated with the given file handle to the beginning of the file.
int BLOCXX_NAMESPACE::FileSystem::close (const FileHandle &hdl)
 Close file handle.
int BLOCXX_NAMESPACE::FileSystem::flush (FileHandle &hdl)
 Flush any buffered data to the file if buffering supported.
String BLOCXX_NAMESPACE::FileSystem::getFileContents (const String &filename)
 Read and return the contents of a text file.
StringArray BLOCXX_NAMESPACE::FileSystem::getFileLines (const String &filename)
 Read and return the lines of a test file.
String BLOCXX_NAMESPACE::FileSystem::readSymbolicLink (const String &path)
 Read the value of a symbolic link.
String BLOCXX_NAMESPACE::FileSystem::Path::realPath (const String &path)
std::pair< ESecurity, String > BLOCXX_NAMESPACE::FileSystem::Path::security (String const &path, UserId uid)
std::pair< ESecurity, String > BLOCXX_NAMESPACE::FileSystem::Path::security (String const &path)
 Equivalent to security(path, uid), where uid is the effective user ID of the process.
std::pair< ESecurity, String > BLOCXX_NAMESPACE::FileSystem::Path::security (String const &base_dir, String const &rel_path, UserId uid)
 A variant of security() that is more efficient if some ancestor directory of the path is already known to be secure and in canonical form.
std::pair< ESecurity, String > BLOCXX_NAMESPACE::FileSystem::Path::security (String const &base_dir, String const &rel_path)
 Equivalent to security(base_dir, rel_path, uid), where uid is the effective user ID of the process.
String BLOCXX_NAMESPACE::FileSystem::Path::dirname (const String &filename)
 Take a string that contains a pathname, and return a string that is a pathname of the parent directory of that file.
String BLOCXX_NAMESPACE::FileSystem::Path::basename (const String &filename)
 Take a string that contains a pathname, and return a string that is the filename with the path removed.
String BLOCXX_NAMESPACE::FileSystem::Path::getCurrentWorkingDirectory ()
 Get the process's current working directory.


Define Documentation

#define MAXPATHLEN   1024


Generated on Wed Feb 25 19:05:00 2009 for blocxx by  doxygen 1.5.6