TCFile.h File Reference

This file provides the definition of TC::File. More...

#include "TCSharedPtr.h"
#include <string>
#include <vector>

Include dependency graph for TCFile.h:

Go to the source code of this file.


struct  TC::File::FileInfo
class  TC::File::Progress


namespace  TC
namespace  TC::File
 Provides functions to get/create/set file information.


enum  TC::File::FileAttributes {
  TC::File::FILEATTR_OWNER_WRITE = 0x00000001,
  TC::File::FILEATTR_OWNER_READ = 0x00000002,
  TC::File::FILEATTR_OWNER_EXEC = 0x00000004,
  TC::File::FILEATTR_GROUP_WRITE = 0x00000008,
  TC::File::FILEATTR_GROUP_READ = 0x00000010,
  TC::File::FILEATTR_GROUP_EXEC = 0x00000020,
  TC::File::FILEATTR_EVERYONE_WRITE = 0x00000040,
  TC::File::FILEATTR_EVERYONE_READ = 0x00000080,
  TC::File::FILEATTR_EVERYONE_EXEC = 0x00000100,
  TC::File::FILEATTR_READONLY = 0x00000200,
  TC::File::FILEATTR_ARCHIVE = 0x00000400,
  TC::File::FILEATTR_SYSTEM = 0x00000800,
  TC::File::FILEATTR_HIDDEN = 0x00001000,
  TC::File::FILEATTR_WRITE = 0x00002000,
  TC::File::FILEATTR_EXECUTE = 0x00004000


bool TC::File::Exists (const std::string &file)
 return if file or directory exists
bool TC::File::IsFile (const std::string &file)
 return if its a file
bool TC::File::IsDirectory (const std::string &file)
 return if file is a directory
bool TC::File::IsReadable (const std::string &file)
 return if the files/directory readable
bool TC::File::IsWriteable (const std::string &file)
 return if the files/directory writeable
bool TC::File::IsExecutable (const std::string &file)
 return if the files/directory executable
bool TC::File::SetFileAttr (const std::string &file, uint32 attr)
 Change the mode flags for this file.
uint64 TC::File::GetFileSize (const std::string &file)
 Get file size.
sint64 TC::File::GetModificationTime (const std::string &file)
 returns time file was last modified
sint64 TC::File::GetLastAccessTime (const std::string &file)
 returns time file was last accessed
sint64 TC::File::GetCreationTime (const std::string &file)
 returns time when created
sint64 TC::File::GetTouchedTime (const std::string &file)
 returns time when touched
std::string TC::File::GetFileUser (const std::string &file)
 get name of file user
std::string TC::File::GetFileGroup (const std::string &file)
 get name of file group
bool TC::File::ChangeDirectory (const std::string &directoryIn)
 change to specified directory
std::string TC::File::GetDirectory ()
 returns current directory
std::vector< std::string > TC::File::GetFileListOfDirectory (const std::string &searchDirectory, const std::string &searchExtension="")
 returns all files with specified extension
void TC::File::GetFileInfosOfDirectory (std::vector< FileInfo > &file_infos, const std::string &searchDirectory, const std::string &searchExtension="")
bool TC::File::Create (const std::string &file, bool removeOld=true)
 create a empty file
bool TC::File::Remove (const std::string &file)
 remove specified file
bool TC::File::Copy (const std::string &source, const std::string &dest, SharedPtr< Progress > copy_status=SharedPtr< Progress >())
 copy source file to destination file
bool TC::File::Move (const std::string &source, const std::string &dest)
 move source file to destination file
bool TC::File::CreateDirectory (const std::string &path)
 create a directory
bool TC::File::CreateDirectoryRecursive (const std::string &path)
 create a directory also if one of the parent directories does not exist

Detailed Description

This file provides the definition of TC::File.

Thomas Goessler

Definition in file TCFile.h.

Copyright (c) Thomas Goessler 2003 - 2008