opentl::core::util::Filesystem Class Reference

List of all members.

Static Public Member Functions

static bool cp (std::string src, std::string dst)
 copy a file (or directory) from src to dst
static bool exists (std::string name)
 checks if file or directory exists
static void ls (std::string dir, std::vector< std::string > &files, std::vector< std::string > &subdirs)
 list contents of a directory push_back() of the results on files- and subdirs-vector
static std::vector< std::string > ls (std::string dir, std::string extension)
 list files in a directory concerning the given filter (postfix)
static bool mkdir (std::string dir)
 creates a directory with the given name (relative to current path or absolute)
static bool mv (std::string src, std::string dst)
 move/rename a file (or directory) from src to dst ATTENTION: deletes an existing dst
static bool rm (std::string file)
 remove a file or a directory with all its contents


Detailed Description

Provides platform independent implementation of some common filesystem operations. The class is basically a wrapper for boost-filesystem calls.

Member Function Documentation

static bool opentl::core::util::Filesystem::cp ( std::string  src,
std::string  dst 
) [static]

copy a file (or directory) from src to dst

Exceptions:
an exception if dst already exists
Returns:
true if dst exists afterwards

static bool opentl::core::util::Filesystem::exists ( std::string  name  )  [static]

checks if file or directory exists

static void opentl::core::util::Filesystem::ls ( std::string  dir,
std::vector< std::string > &  files,
std::vector< std::string > &  subdirs 
) [static]

list contents of a directory push_back() of the results on files- and subdirs-vector

static std::vector<std::string> opentl::core::util::Filesystem::ls ( std::string  dir,
std::string  extension 
) [static]

list files in a directory concerning the given filter (postfix)

static bool opentl::core::util::Filesystem::mkdir ( std::string  dir  )  [static]

creates a directory with the given name (relative to current path or absolute)

static bool opentl::core::util::Filesystem::mv ( std::string  src,
std::string  dst 
) [static]

move/rename a file (or directory) from src to dst ATTENTION: deletes an existing dst

Returns:
true if dst exists afterwards

static bool opentl::core::util::Filesystem::rm ( std::string  file  )  [static]

remove a file or a directory with all its contents


Generated on Thu Jun 10 21:08:09 2010 for OpenTL by  doxygen 1.5.8