MythTV master
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
FileSystemInfo Class Reference

#include <libmythbase/filesysteminfo.h>

Collaboration diagram for FileSystemInfo:
[legend]

Public Member Functions

 FileSystemInfo ()=default
 
 FileSystemInfo (QString hostname, QString path, int groupid=-1)
 
 FileSystemInfo (QString hostname, QString path, bool local, int fsid, int groupid, int blksize, int64_t total, int64_t used)
 
 FileSystemInfo (QStringList::const_iterator &it, const QStringList::const_iterator &end)
 
 FileSystemInfo (const QStringList &slist)
 
void clear ()
 
QString getHostname () const
 
QString getPath () const
 
bool isLocal () const
 
int getFSysID () const
 
int getGroupID () const
 
int getBlockSize () const
 
int64_t getTotalSpace () const
 
int64_t getUsedSpace () const
 
int getWeight () const
 
int64_t getFreeSpace () const
 
void setHostname (QString hostname)
 
void setPath (QString path)
 
void setFSysID (int id)
 
void setUsedSpace (int64_t size)
 
void setWeight (int weight)
 
bool ToStringList (QStringList &slist) const
 
QStringList ToStringList () const
 
bool refresh ()
 update filesystem statistics by reading from the storage device More...
 

Static Public Attributes

static constexpr int kLines = 8
 number of strings in the serialized stringlist More...
 

Private Member Functions

bool FromStringList (const QStringList &slist)
 
bool FromStringList (QStringList::const_iterator &it, const QStringList::const_iterator &listend)
 Deserialize a FileSystemInfo. More...
 

Private Attributes

QString m_hostname
 
QString m_path
 
bool m_local {false}
 set based on QStorageInfo::device() More...
 
int m_fsid {-1}
 set by Consolidate More...
 
int m_grpid {-1}
 set by setGroupID More...
 
int m_blksize {4096}
 
int64_t m_total {0}
 
int64_t m_used {0}
 
int m_weight {0}
 set by setWeight More...
 

Detailed Description

Definition at line 14 of file filesysteminfo.h.

Constructor & Destructor Documentation

◆ FileSystemInfo() [1/5]

FileSystemInfo::FileSystemInfo ( )
default

◆ FileSystemInfo() [2/5]

FileSystemInfo::FileSystemInfo ( QString  hostname,
QString  path,
int  groupid = -1 
)
inline

Definition at line 20 of file filesysteminfo.h.

◆ FileSystemInfo() [3/5]

FileSystemInfo::FileSystemInfo ( QString  hostname,
QString  path,
bool  local,
int  fsid,
int  groupid,
int  blksize,
int64_t  total,
int64_t  used 
)
inline

Definition at line 30 of file filesysteminfo.h.

◆ FileSystemInfo() [4/5]

FileSystemInfo::FileSystemInfo ( QStringList::const_iterator &  it,
const QStringList::const_iterator &  end 
)
inline

Definition at line 49 of file filesysteminfo.h.

◆ FileSystemInfo() [5/5]

FileSystemInfo::FileSystemInfo ( const QStringList &  slist)
inlineexplicit

Definition at line 53 of file filesysteminfo.h.

Member Function Documentation

◆ clear()

void FileSystemInfo::clear ( void  )
inline

Definition at line 55 of file filesysteminfo.h.

Referenced by FromStringList().

◆ FromStringList() [1/2]

bool FileSystemInfo::FromStringList ( const QStringList &  slist)
private

Definition at line 38 of file filesysteminfo.cpp.

Referenced by FromStringList().

◆ FromStringList() [2/2]

bool FileSystemInfo::FromStringList ( QStringList::const_iterator &  it,
const QStringList::const_iterator &  listend 
)
private

Deserialize a FileSystemInfo.

The FileSystemInfo will be in a default state if deserialization fails.

Parameters
[in,out]ititerator to the beginning of the FileSystemInfo to deserialize. It is incremented so this function can be called repeatedly in a while loop. it will be set to listend when there aren't enough strings to deserialize a FileSystemInfo.
[in]listendend of the string list referenced by both iterators
Returns
Boolean, true if deserialized

Definition at line 54 of file filesysteminfo.cpp.

◆ getBlockSize()

int FileSystemInfo::getBlockSize ( ) const
inline

Definition at line 63 of file filesysteminfo.h.

◆ getFreeSpace()

int64_t FileSystemInfo::getFreeSpace ( ) const
inline

◆ getFSysID()

int FileSystemInfo::getFSysID ( ) const
inline

Definition at line 61 of file filesysteminfo.h.

Referenced by Scheduler::FillRecordingDir().

◆ getGroupID()

int FileSystemInfo::getGroupID ( ) const
inline

Definition at line 62 of file filesysteminfo.h.

◆ getHostname()

QString FileSystemInfo::getHostname ( ) const
inline

Definition at line 58 of file filesysteminfo.h.

Referenced by Scheduler::FillRecordingDir().

◆ getPath()

QString FileSystemInfo::getPath ( ) const
inline

Definition at line 59 of file filesysteminfo.h.

Referenced by Scheduler::FillRecordingDir().

◆ getTotalSpace()

int64_t FileSystemInfo::getTotalSpace ( ) const
inline

Definition at line 64 of file filesysteminfo.h.

Referenced by comp_storage_perc_free_space().

◆ getUsedSpace()

int64_t FileSystemInfo::getUsedSpace ( ) const
inline

Definition at line 65 of file filesysteminfo.h.

◆ getWeight()

int FileSystemInfo::getWeight ( ) const
inline

◆ isLocal()

bool FileSystemInfo::isLocal ( ) const
inline

Definition at line 60 of file filesysteminfo.h.

Referenced by comp_storage_combination(), and Scheduler::FillRecordingDir().

◆ refresh()

bool FileSystemInfo::refresh ( )

update filesystem statistics by reading from the storage device

Returns
Boolean, true if successful

Definition at line 79 of file filesysteminfo.cpp.

◆ setFSysID()

void FileSystemInfo::setFSysID ( int  id)
inline

Definition at line 74 of file filesysteminfo.h.

◆ setHostname()

void FileSystemInfo::setHostname ( QString  hostname)
inline

Definition at line 72 of file filesysteminfo.h.

◆ setPath()

void FileSystemInfo::setPath ( QString  path)
inline

Definition at line 73 of file filesysteminfo.h.

◆ setUsedSpace()

void FileSystemInfo::setUsedSpace ( int64_t  size)
inline

Definition at line 75 of file filesysteminfo.h.

◆ setWeight()

void FileSystemInfo::setWeight ( int  weight)
inline

Definition at line 76 of file filesysteminfo.h.

Referenced by Scheduler::FillRecordingDir().

◆ ToStringList() [1/2]

QStringList FileSystemInfo::ToStringList ( ) const

Definition at line 15 of file filesysteminfo.cpp.

Referenced by ToStringList().

◆ ToStringList() [2/2]

bool FileSystemInfo::ToStringList ( QStringList &  slist) const

Definition at line 31 of file filesysteminfo.cpp.

Member Data Documentation

◆ kLines

constexpr int FileSystemInfo::kLines = 8
staticconstexpr

number of strings in the serialized stringlist

Definition at line 17 of file filesysteminfo.h.

Referenced by FileSystemInfoManager::FromStringList(), FromStringList(), PlaybackSock::GetDiskSpace(), and ToStringList().

◆ m_blksize

int FileSystemInfo::m_blksize {4096}
private

Definition at line 95 of file filesysteminfo.h.

Referenced by FromStringList(), refresh(), and ToStringList().

◆ m_fsid

int FileSystemInfo::m_fsid {-1}
private

set by Consolidate

Definition at line 93 of file filesysteminfo.h.

Referenced by FromStringList(), and ToStringList().

◆ m_grpid

int FileSystemInfo::m_grpid {-1}
private

set by setGroupID

Definition at line 94 of file filesysteminfo.h.

Referenced by FromStringList(), and ToStringList().

◆ m_hostname

QString FileSystemInfo::m_hostname
private

Definition at line 90 of file filesysteminfo.h.

Referenced by FromStringList(), and ToStringList().

◆ m_local

bool FileSystemInfo::m_local {false}
private

set based on QStorageInfo::device()

Definition at line 92 of file filesysteminfo.h.

Referenced by FromStringList(), refresh(), and ToStringList().

◆ m_path

QString FileSystemInfo::m_path
private

Definition at line 91 of file filesysteminfo.h.

Referenced by FromStringList(), refresh(), and ToStringList().

◆ m_total

int64_t FileSystemInfo::m_total {0}
private

Definition at line 96 of file filesysteminfo.h.

Referenced by FromStringList(), refresh(), and ToStringList().

◆ m_used

int64_t FileSystemInfo::m_used {0}
private

Definition at line 97 of file filesysteminfo.h.

Referenced by FromStringList(), refresh(), and ToStringList().

◆ m_weight

int FileSystemInfo::m_weight {0}
private

set by setWeight

Definition at line 100 of file filesysteminfo.h.

Referenced by FromStringList().


The documentation for this class was generated from the following files: