|
MythTV
0.26-pre
|
#include <storagegroup.h>
Public Member Functions | |
| StorageGroup (const QString group="", const QString hostname="", const bool allowFallback=true) | |
| StorageGroup constructor. | |
| void | Init (const QString group="Default", const QString hostname="", const bool allowFallback=true) |
| Initilizes the groupname, hostname, and dirlist. | |
| QString | getName (void) const |
| QStringList | GetDirList (void) const |
| QString | GetFirstDir (bool appendSlash=false) const |
| QStringList | GetDirFileList (QString dir, QString base, bool recursive=false) |
| QStringList | GetFileList (QString Path, bool recursive=false) |
| QStringList | GetFileInfoList (QString Path) |
| bool | FileExists (QString filename) |
| QStringList | GetFileInfo (QString filename) |
| QString | FindFile (QString filename) |
| QString | FindFileDir (QString filename) |
| QString | FindNextDirMostFree (void) |
Static Public Member Functions | |
| static QString | GetRelativePathname (const QString &filename) |
| Returns the relative pathname of a file by comparing the filename against all Storage Group directories (and MythVideo's startupdir) | |
| static bool | FindDirs (const QString group="Default", const QString hostname="", QStringList *dirlist=NULL) |
| Finds and and optionally initialize a directory list associated with a Storage Group. | |
| static void | CheckAllStorageGroupDirs (void) |
| static QStringList | getRecordingsGroups (void) |
| static QStringList | getGroupDirs (QString groupname, QString host) |
| static void | ClearGroupToUseCache (void) |
| static QString | GetGroupToUse (const QString &host, const QString &sgroup) |
Static Public Attributes | |
| static const char * | kDefaultStorageDir = "/mnt/store" |
| static const QStringList | kSpecialGroups = "Banners" |
Static Private Member Functions | |
| static void | StaticInit (void) |
Private Attributes | |
| QString | m_groupname |
| QString | m_hostname |
| bool | m_allowFallback |
| QStringList | m_dirlist |
Static Private Attributes | |
| static bool | m_staticInitDone = false |
| static QMutex | m_staticInitLock |
| static QMap< QString, QString > | m_builtinGroups |
| static QMutex | s_groupToUseLock |
| static QHash< QString, QString > | s_groupToUseCache |
Definition at line 11 of file storagegroup.h.
| StorageGroup::StorageGroup | ( | const QString | group = "", |
| const QString | hostname = "", |
||
| const bool | allowFallback = true |
||
| ) |
StorageGroup constructor.
| group | storage group to search, blank will search all groups. |
| hostname | hostname where to search, blank will search all hosts' directories, but only in local directory structure. This is parameter is ignored if group is an empty string. |
| allowFallback | allow the storage group search code to fall back if no dirs exist for the specified group/host |
Definition at line 45 of file storagegroup.cpp.
| void StorageGroup::Init | ( | const QString | group = "Default", |
| const QString | hostname = "", |
||
| const bool | allowFallback = true |
||
| ) |
Initilizes the groupname, hostname, and dirlist.
First attempts to find the Storage Group defined with the specified name for the given host. If not found, checks for the named Storage Group, as defined across all hosts. If not found, tries the "Default" Storage Group for the given host. If not found, tries the "Default" Storage Group, as defined across all hosts.
| group | The name of the Storage Group |
| hostname | The host whose Storage Group definition is desired |
Definition at line 101 of file storagegroup.cpp.
Referenced by getLocalStorageGroupPath(), FileServerHandler::LocalFilePath(), MainServer::LocalFilePath(), and StorageGroup().
| QString StorageGroup::getName | ( | void | ) | const [inline] |
Definition at line 21 of file storagegroup.h.
| QStringList StorageGroup::GetDirList | ( | void | ) | const [inline] |
Definition at line 24 of file storagegroup.h.
Referenced by Scheduler::FillRecordingDir(), and DBUtil::GetBackupDirectory().
| QString StorageGroup::GetFirstDir | ( | bool | appendSlash = false | ) | const |
Definition at line 189 of file storagegroup.cpp.
Referenced by HttpConfig::ProcessRequest().
| QStringList StorageGroup::GetDirFileList | ( | QString | dir, |
| QString | base, | ||
| bool | recursive = false |
||
| ) |
Definition at line 203 of file storagegroup.cpp.
Referenced by GetFileList().
| QStringList StorageGroup::GetFileList | ( | QString | Path, |
| bool | recursive = false |
||
| ) |
Definition at line 249 of file storagegroup.cpp.
Referenced by Content::GetFileList(), FileServerHandler::HandleGetFileList(), and MainServer::HandleSGGetFileList().
| QStringList StorageGroup::GetFileInfoList | ( | QString | Path | ) |
Definition at line 267 of file storagegroup.cpp.
Referenced by FileServerHandler::HandleGetFileList(), MainServer::HandleSGGetFileList(), and HttpConfig::ProcessRequest().
| bool StorageGroup::FileExists | ( | QString | filename | ) |
Definition at line 332 of file storagegroup.cpp.
Referenced by GetFileInfo(), and ProgramInfo::GetPlaybackURL().
| QStringList StorageGroup::GetFileInfo | ( | QString | filename | ) |
Definition at line 364 of file storagegroup.cpp.
Referenced by FileServerHandler::HandleFileQuery(), and MainServer::HandleSGFileQuery().
| QString StorageGroup::GetRelativePathname | ( | const QString & | filename | ) | [static] |
Returns the relative pathname of a file by comparing the filename against all Storage Group directories (and MythVideo's startupdir)
| filename | The full pathname of the file to use |
Definition at line 399 of file storagegroup.cpp.
Referenced by ProgramInfo::ClearMarkupMap(), ProgramInfo::ClearPositionMap(), doUpgradeVideoDatabaseSchema(), FileServerHandler::HandleDownloadFile(), MainServer::HandleDownloadFile(), ProgramInfo::QueryMarkupMap(), ProgramInfo::QueryPositionMap(), ProgramInfo::SaveMarkupMap(), ProgramInfo::SavePositionMap(), and ProgramInfo::SavePositionMapDelta().
| bool StorageGroup::FindDirs | ( | const QString | group = "Default", |
| const QString | hostname = "", |
||
| QStringList * | dirlist = NULL |
||
| ) | [static] |
Finds and and optionally initialize a directory list associated with a Storage Group.
| group | The name of the Storage Group |
| hostname | The host whose directory list should be checked, first |
| dirlist | Optional pointer to a QStringList to hold found dir list |
Definition at line 515 of file storagegroup.cpp.
Referenced by GetGroupToUse(), and Init().
| QString StorageGroup::FindFile | ( | QString | filename | ) |
Definition at line 581 of file storagegroup.cpp.
Referenced by UPnpCDSTv::AddItem(), UPnpCDSVideo::AddItem(), Content::AddLiveStream(), Video::AddVideo(), Content::AddVideoLiveStream(), MainServer::DeleteRecordedFiles(), Content::GetFile(), GetFileInfo(), Content::GetHash(), Content::GetImageFile(), MetadataDownload::getMXMLPath(), MetadataDownload::getNFOPath(), ProgramInfo::GetPlaybackURL(), FileServerHandler::HandleDeleteFile(), MainServer::HandleDeleteFile(), FileServerHandler::HandleQueryFileExists(), MainServer::HandleQueryFileExists(), FileServerHandler::HandleQueryFileHash(), MainServer::HandleQueryFileHash(), FileServerHandler::LocalFilePath(), MainServer::LocalFilePath(), HtmlServerExtension::ProcessRequest(), PreviewGenerator::Run(), MetadataImageDownload::run(), and VideoMetadata::VideoFileHash().
| QString StorageGroup::FindFileDir | ( | QString | filename | ) |
Definition at line 604 of file storagegroup.cpp.
Referenced by FindFile(), and FindFileDir().
| QString StorageGroup::FindNextDirMostFree | ( | void | ) |
Definition at line 655 of file storagegroup.cpp.
Referenced by Content::DownloadFile(), getLocalStorageGroupPath(), FileServerHandler::HandleAnnounce(), MainServer::HandleAnnounce(), FileServerHandler::HandleDownloadFile(), and MainServer::HandleDownloadFile().
| void StorageGroup::CheckAllStorageGroupDirs | ( | void | ) | [static] |
Definition at line 711 of file storagegroup.cpp.
Referenced by run_backend().
| QStringList StorageGroup::getRecordingsGroups | ( | void | ) | [static] |
Definition at line 771 of file storagegroup.cpp.
Referenced by StoreOptMixin::Load().
| QStringList StorageGroup::getGroupDirs | ( | QString | groupname, |
| QString | host | ||
| ) | [static] |
Definition at line 797 of file storagegroup.cpp.
Referenced by GetVideoDirsByHost().
| void StorageGroup::ClearGroupToUseCache | ( | void | ) | [static] |
Definition at line 842 of file storagegroup.cpp.
Referenced by PBHEventHandler::PBHEventHandler(), and VideoDialog::VideoDialog().
| QString StorageGroup::GetGroupToUse | ( | const QString & | host, |
| const QString & | sgroup | ||
| ) | [static] |
Definition at line 848 of file storagegroup.cpp.
Referenced by generate_file_url(), generate_myth_url(), and RemoteGetFileList().
| void StorageGroup::StaticInit | ( | void | ) | [static, private] |
Definition at line 59 of file storagegroup.cpp.
Referenced by FindDirs(), GetRelativePathname(), and Init().
const char * StorageGroup::kDefaultStorageDir = "/mnt/store" [static] |
Definition at line 46 of file storagegroup.h.
Referenced by FindNextDirMostFree(), and Init().
const QStringList StorageGroup::kSpecialGroups = "Banners" [static] |
Definition at line 47 of file storagegroup.h.
Referenced by MainServer::BackendQueryDiskSpace(), StorageGroupListEditor::doDelete(), getRecordingsGroups(), StorageGroupListEditor::Load(), FileServerHandler::QueryFileSystems(), StorageGroupEditor::StorageGroupEditor(), and ProgramInfo::ToMap().
bool StorageGroup::m_staticInitDone = false [static, private] |
Definition at line 58 of file storagegroup.h.
Referenced by StaticInit().
QMutex StorageGroup::m_staticInitLock [static, private] |
Definition at line 59 of file storagegroup.h.
Referenced by StaticInit().
QString StorageGroup::m_groupname [private] |
Definition at line 61 of file storagegroup.h.
Referenced by CheckAllStorageGroupDirs(), FindFileDir(), Init(), and StorageGroup().
QString StorageGroup::m_hostname [private] |
Definition at line 62 of file storagegroup.h.
Referenced by Init(), and StorageGroup().
bool StorageGroup::m_allowFallback [private] |
Definition at line 63 of file storagegroup.h.
Referenced by FindFileDir(), FindNextDirMostFree(), Init(), and StorageGroup().
QStringList StorageGroup::m_dirlist [private] |
Definition at line 64 of file storagegroup.h.
Referenced by FileExists(), FindFileDir(), FindNextDirMostFree(), GetFileInfoList(), GetFileList(), GetFirstDir(), Init(), and StorageGroup().
QMap< QString, QString > StorageGroup::m_builtinGroups [static, private] |
Definition at line 66 of file storagegroup.h.
Referenced by FindDirs(), GetRelativePathname(), Init(), and StaticInit().
QMutex StorageGroup::s_groupToUseLock [static, private] |
Definition at line 68 of file storagegroup.h.
Referenced by ClearGroupToUseCache(), and GetGroupToUse().
QHash< QString, QString > StorageGroup::s_groupToUseCache [static, private] |
Definition at line 69 of file storagegroup.h.
Referenced by ClearGroupToUseCache(), and GetGroupToUse().
1.7.6.1