|
ZNC trunk
|
#include <FileUtils.h>
Public Types | |
| enum | EFileTypes { FT_REGULAR , FT_DIRECTORY , FT_CHARACTER , FT_BLOCK , FT_FIFO , FT_LINK , FT_SOCK } |
| enum | EFileAttr { FA_Name , FA_Size , FA_ATime , FA_MTime , FA_CTime , FA_UID } |
Public Member Functions | |
| CFile () | |
| CFile (const CString &sLongName) | |
| ~CFile () | |
| void | SetFileName (const CString &sLongName) |
| bool | IsReg (bool bUseLstat=false) const |
| bool | IsDir (bool bUseLstat=false) const |
| bool | IsChr (bool bUseLstat=false) const |
| bool | IsBlk (bool bUseLstat=false) const |
| bool | IsFifo (bool bUseLstat=false) const |
| bool | IsLnk (bool bUseLstat=true) const |
| bool | IsSock (bool bUseLstat=false) const |
| bool | Exists () const |
| off_t | GetSize () const |
| time_t | GetATime () const |
| time_t | GetMTime () const |
| time_t | GetCTime () const |
| uid_t | GetUID () const |
| gid_t | GetGID () const |
| bool | Delete () |
| bool | Move (const CString &sNewFileName, bool bOverwrite=false) |
| bool | Copy (const CString &sNewFileName, bool bOverwrite=false) |
| bool | Chmod (mode_t mode) |
| bool | Seek (off_t uPos) |
| bool | Truncate () |
| bool | Sync () |
| bool | Open (const CString &sFileName, int iFlags=O_RDONLY, mode_t iMode=0644) |
| bool | Open (int iFlags=O_RDONLY, mode_t iMode=0644) |
| ssize_t | Read (char *pszBuffer, int iBytes) |
| bool | ReadLine (CString &sData, const CString &sDelimiter="\n") |
| bool | ReadFile (CString &sData, size_t iMaxSize=512 *1024) |
| ssize_t | Write (const char *pszBuffer, size_t iBytes) |
| ssize_t | Write (const CString &sData) |
| void | Close () |
| void | ClearBuffer () |
| bool | TryExLock (const CString &sLockFile, int iFlags=O_RDWR|O_CREAT) |
| bool | TryExLock () |
| bool | ExLock () |
| bool | UnLock () |
| bool | IsOpen () const |
| CString | GetLongName () const |
| CString | GetShortName () const |
| CString | GetDir () const |
| bool | HadError () const |
| void | ResetError () |
Static Public Member Functions | |
| static bool | IsReg (const CString &sLongName, bool bUseLstat=false) |
| static bool | IsDir (const CString &sLongName, bool bUseLstat=false) |
| static bool | IsChr (const CString &sLongName, bool bUseLstat=false) |
| static bool | IsBlk (const CString &sLongName, bool bUseLstat=false) |
| static bool | IsFifo (const CString &sLongName, bool bUseLstat=false) |
| static bool | IsLnk (const CString &sLongName, bool bUseLstat=true) |
| static bool | IsSock (const CString &sLongName, bool bUseLstat=false) |
| static bool | FType (const CString &sFileName, EFileTypes eType, bool bUseLstat=false) |
| static bool | Exists (const CString &sFile) |
| static off_t | GetSize (const CString &sFile) |
| static time_t | GetATime (const CString &sFile) |
| static time_t | GetMTime (const CString &sFile) |
| static time_t | GetCTime (const CString &sFile) |
| static uid_t | GetUID (const CString &sFile) |
| static gid_t | GetGID (const CString &sFile) |
| static int | GetInfo (const CString &sFile, struct stat &st) |
| static bool | Delete (const CString &sFileName) |
| static bool | Move (const CString &sOldFileName, const CString &sNewFileName, bool bOverwrite=false) |
| static bool | Copy (const CString &sOldFileName, const CString &sNewFileName, bool bOverwrite=false) |
| static bool | Chmod (const CString &sFile, mode_t mode) |
| static void | InitHomePath (const CString &sFallback) |
| static const CString & | GetHomePath () |
Protected Attributes | |
| CString | m_sLongName |
| Absolute filename (m_sPath + "/" + m_sShortName). | |
| CString | m_sShortName |
| Filename alone, without path. | |
| enum CFile::EFileAttr |
| enum CFile::EFileTypes |
| CFile::CFile | ( | ) |
| CFile::CFile | ( | const CString & | sLongName | ) |
| CFile::~CFile | ( | ) |
|
static |
| bool CFile::Chmod | ( | mode_t | mode | ) |
| void CFile::ClearBuffer | ( | ) |
| void CFile::Close | ( | ) |
| bool CFile::Copy | ( | const CString & | sNewFileName, |
| bool | bOverwrite = false ) |
|
static |
| bool CFile::Delete | ( | ) |
|
static |
| bool CFile::Exists | ( | ) | const |
|
static |
| bool CFile::ExLock | ( | ) |
|
static |
| time_t CFile::GetATime | ( | ) | const |
|
static |
| time_t CFile::GetCTime | ( | ) | const |
|
static |
| CString CFile::GetDir | ( | ) | const |
| gid_t CFile::GetGID | ( | ) | const |
|
static |
|
inlinestatic |
|
static |
| CString CFile::GetLongName | ( | ) | const |
| time_t CFile::GetMTime | ( | ) | const |
|
static |
| CString CFile::GetShortName | ( | ) | const |
| off_t CFile::GetSize | ( | ) | const |
|
static |
| uid_t CFile::GetUID | ( | ) | const |
|
static |
|
inline |
|
static |
| bool CFile::IsBlk | ( | bool | bUseLstat = false | ) | const |
|
static |
| bool CFile::IsChr | ( | bool | bUseLstat = false | ) | const |
|
static |
| bool CFile::IsDir | ( | bool | bUseLstat = false | ) | const |
|
static |
| bool CFile::IsFifo | ( | bool | bUseLstat = false | ) | const |
|
static |
| bool CFile::IsLnk | ( | bool | bUseLstat = true | ) | const |
|
static |
| bool CFile::IsOpen | ( | ) | const |
| bool CFile::IsReg | ( | bool | bUseLstat = false | ) | const |
|
static |
| bool CFile::IsSock | ( | bool | bUseLstat = false | ) | const |
|
static |
| bool CFile::Move | ( | const CString & | sNewFileName, |
| bool | bOverwrite = false ) |
|
static |
| bool CFile::Open | ( | const CString & | sFileName, |
| int | iFlags = O_RDONLY, | ||
| mode_t | iMode = 0644 ) |
| bool CFile::Open | ( | int | iFlags = O_RDONLY, |
| mode_t | iMode = 0644 ) |
| ssize_t CFile::Read | ( | char * | pszBuffer, |
| int | iBytes ) |
| bool CFile::ReadFile | ( | CString & | sData, |
| size_t | iMaxSize = 512 *1024 ) |
|
inline |
| bool CFile::Seek | ( | off_t | uPos | ) |
| void CFile::SetFileName | ( | const CString & | sLongName | ) |
| bool CFile::Sync | ( | ) |
| bool CFile::Truncate | ( | ) |
| bool CFile::TryExLock | ( | ) |
| bool CFile::TryExLock | ( | const CString & | sLockFile, |
| int | iFlags = O_RDWR|O_CREAT ) |
| bool CFile::UnLock | ( | ) |
| ssize_t CFile::Write | ( | const char * | pszBuffer, |
| size_t | iBytes ) |
| ssize_t CFile::Write | ( | const CString & | sData | ) |
|
protected |
Absolute filename (m_sPath + "/" + m_sShortName).
|
protected |
Filename alone, without path.