Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CFileItem Class Reference

Represents a file on a share. More...

#include <FileItem.h>

Inheritance diagram for CFileItem:
CGUIListItem IArchivable ISerializable ISortable CFileItemList CGUIStaticItem

Public Member Functions

 CFileItem ()
 
 CFileItem (const CFileItem &item)
 
 CFileItem (const CGUIListItem &item)
 
 CFileItem (const std::string &strLabel)
 
 CFileItem (const char *strLabel)
 
 CFileItem (const CURL &path, bool bIsFolder)
 
 CFileItem (std::string_view strPath, bool bIsFolder)
 
 CFileItem (const CSong &song)
 
 CFileItem (const CSong &song, const MUSIC_INFO::CMusicInfoTag &music)
 
 CFileItem (const CURL &path, const CAlbum &album)
 
 CFileItem (std::string_view path, const CAlbum &album)
 
 CFileItem (const CArtist &artist)
 
 CFileItem (const CGenre &genre)
 
 CFileItem (const MUSIC_INFO::CMusicInfoTag &music)
 
 CFileItem (const CVideoInfoTag &movie)
 
 CFileItem (const std::shared_ptr< PVR::CPVREpgInfoTag > &tag)
 
 CFileItem (const std::shared_ptr< PVR::CPVREpgSearchFilter > &filter)
 
 CFileItem (const std::shared_ptr< PVR::CPVRChannelGroupMember > &channelGroupMember)
 
 CFileItem (const std::shared_ptr< PVR::CPVRRecording > &record)
 
 CFileItem (const std::shared_ptr< PVR::CPVRTimerInfoTag > &timer)
 
 CFileItem (const std::string_view path, const std::shared_ptr< PVR::CPVRProvider > &provider)
 
 CFileItem (const CMediaSource &share)
 
 CFileItem (const std::shared_ptr< const ADDON::IAddon > &addonInfo)
 
 CFileItem (const std::shared_ptr< const IEvent > &eventLogEntry)
 
 ~CFileItem () override
 
CGUIListItemClone () const override
 
CURL GetURL () const
 
void SetURL (const CURL &url)
 
bool IsURL (const CURL &url) const
 
const std::string & GetPath () const
 
void SetPath (std::string_view path)
 
bool IsPath (const std::string &path, bool ignoreURLOptions=false) const
 
CURL GetDynURL () const
 
void SetDynURL (const CURL &url)
 
const std::string & GetDynPath () const
 
void SetDynPath (std::string_view path)
 
CFileItemoperator= (const CFileItem &item)
 
void Archive (CArchive &ar) override
 
void Serialize (CVariant &value) const override
 
void ToSortable (SortItem &sortable, Field field) const override
 
void ToSortable (SortItem &sortable, const Fields &fields) const
 
bool IsFileItem () const override
 
bool Exists (bool bUseCache=true) const
 
bool IsPicture () const
 Check whether an item is a picture item. Note that this returns true for anything with a picture info tag, so that may include eg. folders.
 
bool IsDeleted () const
 Check whether an item is 'deleted' (for example, a trashed pvr recording).
 
bool IsGame () const
 
bool IsLibraryFolder () const
 
bool IsPythonScript () const
 
bool IsPlugin () const
 
bool IsScript () const
 
bool IsAddonsPath () const
 
bool IsSourcesPath () const
 
bool IsNFO () const
 
bool IsDiscImage () const
 
bool IsOpticalMediaFile () const
 
bool IsBluray () const
 
bool IsRAR () const
 
bool IsAPK () const
 
bool IsZIP () const
 
bool IsCBZ () const
 
bool IsCBR () const
 
bool IsISO9660 () const
 
bool IsDVD () const
 
bool IsOnDVD () const
 
bool IsHD () const
 
bool IsNfs () const
 
bool IsSmb () const
 
bool IsURL () const
 
bool IsStack () const
 
bool IsFavourite () const
 
bool IsMultiPath () const
 
bool IsEPG () const
 
bool IsPVRChannel () const
 
bool IsPVRChannelGroup () const
 
bool IsPVRRecording () const
 
bool IsUsablePVRRecording () const
 
bool IsDeletedPVRRecording () const
 
bool IsInProgressPVRRecording () const
 
bool IsPVRTimer () const
 
bool IsPVRProvider () const
 
bool IsType (const char *ext) const
 
bool IsVirtualDirectoryRoot () const
 
bool IsReadOnly () const
 
bool CanQueue () const
 
void SetCanQueue (bool bYesNo)
 
bool IsParentFolder () const
 
bool IsFileFolder (FileFolderType types=FileFolderType::MASK_ALL) const
 
bool IsRemovable () const
 
bool IsPVR () const
 
bool IsLiveTV () const
 
bool IsRSS () const
 
bool IsAndroidApp () const
 
bool HasVideoVersions () const
 
bool HasVideoExtras () const
 
void RemoveExtension ()
 
void CleanString ()
 
void SetFileSizeLabel ()
 
void SetLabel (const std::string &strLabel) override
 
VideoDbContentType GetVideoContentType () const
 
bool IsLabelPreformatted () const
 
void SetLabelPreformatted (bool bYesNo)
 
const std::string & GetDVDLabel () const
 
void SetDVDLabel (std::string_view label)
 
bool IsShareOrDrive () const
 
void SetIsShareOrDrive (bool set)
 
SourceType GetDriveType () const
 
void SetDriveType (SourceType driveType)
 
const CDateTimeGetDateTime () const
 
void SetDateTime (const CDateTime &dateTime)
 
void SetDateTime (time_t dateTime)
 
void SetDateTime (KODI::TIME::SystemTime dateTime)
 
void SetDateTime (KODI::TIME::FileTime dateTime)
 
int64_t GetSize () const
 
void SetSize (int64_t size)
 
const std::string & GetTitle () const
 
void SetTitle (std::string_view title)
 
int GetProgramCount () const
 
void SetProgramCount (int count)
 
int GetDepth () const
 
void SetDepth (int depth)
 
int GetStartPartNumber () const
 
void SetStartPartNumber (int number)
 
bool SortsOnTop () const
 
bool SortsOnBottom () const
 
void SetSpecialSort (SortSpecial sort)
 
bool HasMusicInfoTag () const
 
MUSIC_INFO::CMusicInfoTagGetMusicInfoTag ()
 
const MUSIC_INFO::CMusicInfoTagGetMusicInfoTag () const
 
bool HasVideoInfoTag () const
 
CVideoInfoTagGetVideoInfoTag ()
 
const CVideoInfoTagGetVideoInfoTag () const
 
bool HasEPGInfoTag () const
 
std::shared_ptr< PVR::CPVREpgInfoTagGetEPGInfoTag () const
 
bool HasEPGSearchFilter () const
 
std::shared_ptr< PVR::CPVREpgSearchFilterGetEPGSearchFilter () const
 
bool HasPVRChannelGroupMemberInfoTag () const
 
std::shared_ptr< PVR::CPVRChannelGroupMemberGetPVRChannelGroupMemberInfoTag () const
 
bool HasPVRChannelInfoTag () const
 
std::shared_ptr< PVR::CPVRChannelGetPVRChannelInfoTag () const
 
bool HasPVRRecordingInfoTag () const
 
std::shared_ptr< PVR::CPVRRecordingGetPVRRecordingInfoTag () const
 
bool HasPVRTimerInfoTag () const
 
std::shared_ptr< PVR::CPVRTimerInfoTagGetPVRTimerInfoTag () const
 
bool HasPVRProviderInfoTag () const
 
std::shared_ptr< PVR::CPVRProviderGetPVRProviderInfoTag () const
 
CFileItem GetItemToPlay () const
 return the item to play. will be almost 'this', but can be different (e.g. "Play recording" from PVR EPG grid window)
 
bool IsResumePointSet () const
 Test if this item has a valid resume point set.
 
double GetCurrentResumeTime () const
 Return the current resume time.
 
bool GetCurrentResumeTimeAndPartNumber (int64_t &startOffset, int &partNumber) const
 Return the current resume time and part.
 
bool IsResumable () const
 Test if this item type can be resumed.
 
int64_t GetStartOffset () const
 Get the offset where start the playback.
 
void SetStartOffset (const int64_t offset)
 Set the offset where start the playback.
 
int64_t GetEndOffset () const
 Get the end offset.
 
void SetEndOffset (const int64_t offset)
 Set the end offset.
 
bool HasPictureInfoTag () const
 
const CPictureInfoTagGetPictureInfoTag () const
 
bool HasAddonInfo () const
 
std::shared_ptr< const ADDON::IAddonGetAddonInfo () const
 
bool HasGameInfoTag () const
 
KODI::GAME::CGameInfoTagGetGameInfoTag ()
 
const KODI::GAME::CGameInfoTagGetGameInfoTag () const
 
CPictureInfoTagGetPictureInfoTag ()
 
std::string FindLocalArt (const std::string &artFile, bool useFolder) const
 Assemble the filename of a particular piece of local artwork for an item, and check for file existence.
 
bool SkipLocalArt () const
 Whether or not to skip searching for local art.
 
std::string GetThumbHideIfUnwatched (const CFileItem *item) const
 Get the thumb for the item, but hide it to prevent spoilers if the user has set 'Show information for unwatched items' appropriately.
 
std::string GetMovieName (bool bUseFolderNames=false) const
 
std::string GetBaseMoviePath (bool useFolderNames) const
 Find the base movie path (i.e. the item the user expects us to use to lookup the movie) For folder items, with "use foldernames for lookups" it returns the folder. Regardless of settings, for VIDEO_TS/BDMV it returns the parent of the VIDEO_TS/BDMV folder (if present)
 
std::string GetUserMusicThumb (bool alwaysCheckRemote=false, bool fallbackToFolder=false) const
 
std::string GetLocalMetadataPath () const
 Get the path where we expect local metadata to reside. For a folder, this is just the existing path (eg tvshow folder) For a file, this is the parent path, with exceptions made for VIDEO_TS and BDMV files.
 
bool LoadMusicTag ()
 
bool LoadGameTag ()
 
bool LoadDetails ()
 Load detailed data for an item constructed with only a path and a folder flag Fills item's video info tag, sets item properties.
 
const std::string & GetMimeType () const
 
void SetMimeType (std::string_view mimetype)
 
void FillInMimeType (bool lookup=true)
 Resolve the MIME type based on file extension or a web lookup If m_mimetype is already set (non-empty), this function has no effect. For http:// and shout:// streams, this will query the stream (blocking operation). Set lookup=false to skip any internet lookups and always return immediately.
 
bool ContentLookup () const
 Some sources do not support HTTP HEAD request to determine i.e. mime type.
 
void SetMimeTypeForInternetFile ()
 (Re)set the mime-type for internet files if allowed (m_doContentLookup) Some sources do not support HTTP HEAD request to determine i.e. mime type
 
void SetContentLookup (bool enable)
 Lookup via HTTP HEAD request might not be needed, use this setter to disable ContentLookup.
 
void SetExtraInfo (std::string_view info)
 
const std::string & GetExtraInfo () const
 
void UpdateInfo (const CFileItem &item, bool replaceLabels=true)
 Update an item with information from another item We take metadata information from the given item and supplement the current item with that info. If tags exist in the new item we use the entire tag information. Properties are appended, and labels, thumbnail and icon are updated if non-empty in the given item.
 
void MergeInfo (const CFileItem &item)
 Merge an item with information from another item We take metadata/art information from the given item and supplement the current item with that info. If tags exist in the new item we only merge the missing tag information. Properties are appended, and labels are updated if non-empty in the given item.
 
bool IsSamePath (const CFileItem *item) const
 
bool IsAlbum () const
 
void SetFromVideoInfoTag (const CVideoInfoTag &video)
 Sets details using the information from the CVideoInfoTag object Sets the videoinfotag and uses its information to set the label and path.
 
void SetFromMusicInfoTag (const MUSIC_INFO::CMusicInfoTag &music)
 Sets details using the information from the CMusicInfoTag object Sets the musicinfotag and uses its information to set the label and path.
 
void SetFromAlbum (const CAlbum &album)
 Sets details using the information from the CAlbum object Sets the album in the music info tag and uses its information to set the label and album-specific properties.
 
void SetFromSong (const CSong &song)
 Sets details using the information from the CSong object Sets the song in the music info tag and uses its information to set the label, path, song-specific properties and artwork.
 
KODI::UTILS::CLockInfoGetLockInfo ()
 Retrieve item's lock information, like lock code, lock mode, etc.
 
const KODI::UTILS::CLockInfoGetLockInfo () const
 Retrieve item's lock information, like lock code, lock mode, etc.
 
void SetCueDocument (const std::shared_ptr< CCueDocument > &cuePtr)
 
void LoadEmbeddedCue ()
 
bool HasCueDocument () const
 
bool LoadTracksFromCueDocument (CFileItemList &scannedItems)
 
- Public Member Functions inherited from CGUIListItem
 CGUIListItem (void)
 
 CGUIListItem (const CGUIListItem &item)
 
 CGUIListItem (const std::string &strLabel)
 
virtual ~CGUIListItem (void)
 
CGUIListItemoperator= (const CGUIListItem &item)
 
const std::string & GetLabel () const
 
void SetLabel2 (const std::string &strLabel)
 
const std::string & GetLabel2 () const
 
void SetOverlayImage (GUIIconOverlay icon)
 
std::string GetOverlayImage () const
 
void SetArt (const std::string &type, const std::string &url)
 Set a particular art type for an item.
 
void SetArt (const ArtMap &art)
 set artwork for an item
 
void AppendArt (const ArtMap &art, const std::string &prefix="")
 append artwork to an item
 
void SetArtFallback (const std::string &from, const std::string &to)
 set a fallback image for art
 
void ClearArt ()
 clear art on an item
 
std::string GetArt (const std::string &type) const
 Get a particular art type for an item.
 
const ArtMapGetArt () const
 get artwork for an item Retrieves artwork in a type:url map
 
bool HasArt (const std::string &type) const
 Check whether an item has a particular piece of art Equivalent to !GetArt(type).empty()
 
void SetSortLabel (const std::string &label)
 
void SetSortLabel (const std::wstring &label)
 
const std::wstring & GetSortLabel () const
 
void Select (bool bOnOff)
 
bool IsSelected () const
 
bool HasOverlay () const
 
void SetLayout (std::unique_ptr< CGUIListItemLayout > layout)
 
CGUIListItemLayoutGetLayout ()
 
void SetFocusedLayout (std::unique_ptr< CGUIListItemLayout > layout)
 
CGUIListItemLayoutGetFocusedLayout ()
 
void FreeIcons ()
 
void FreeMemory (bool immediately=false)
 
void SetInvalid ()
 
void SetProperty (const std::string &strKey, const CVariant &value)
 
void IncrementProperty (const std::string &strKey, int nVal)
 
void IncrementProperty (const std::string &strKey, int64_t nVal)
 
void IncrementProperty (const std::string &strKey, double dVal)
 
void ClearProperties ()
 
void AppendProperties (const CGUIListItem &item)
 Append the properties of one CGUIListItem to another. Any existing properties in the current item will be overridden if they are set in the passed in item.
 
void Archive (CArchive &ar)
 
void Serialize (CVariant &value)
 
bool HasProperty (const std::string &strKey) const
 
bool HasProperties () const
 
void ClearProperty (const std::string &strKey)
 
const CVariantGetProperty (const std::string &strKey) const
 
void SetCurrentItem (unsigned int position)
 Set the current item number within it's container Our container classes will set this member with the items position in the container starting at 1.
 
unsigned int GetCurrentItem () const
 Get the current item number within it's container Retrieve the items position in a container, this is useful to show for example numbering in front of entities in an arbitrary list of entities, like songs of a playlist.
 

Additional Inherited Members

- Public Types inherited from CGUIListItem
enum  GUIIconOverlay {
  ICON_OVERLAY_NONE = 0 , ICON_OVERLAY_RAR , ICON_OVERLAY_ZIP , ICON_OVERLAY_LOCKED ,
  ICON_OVERLAY_UNWATCHED , ICON_OVERLAY_WATCHED , ICON_OVERLAY_HD
}
 
typedef std::map< std::string, std::string > ArtMap
 
- Public Attributes inherited from CGUIListItem
bool m_bIsFolder
 is item a folder or a file
 
- Protected Types inherited from CGUIListItem
typedef std::map< std::string, CVariant, icomparePropertyMap
 
- Protected Member Functions inherited from IArchivable
virtual ~IArchivable ()=default
 
- Protected Member Functions inherited from ISerializable
 ~ISerializable ()=default
 
- Protected Member Functions inherited from ISortable
 ~ISortable ()=default
 
- Protected Attributes inherited from CGUIListItem
std::string m_strLabel2
 
GUIIconOverlay m_overlayIcon
 
std::unique_ptr< CGUIListItemLayoutm_layout
 
std::unique_ptr< CGUIListItemLayoutm_focusedLayout
 
bool m_bSelected
 
unsigned int m_currentItem
 
PropertyMap m_mapProperties
 

Detailed Description

Represents a file on a share.

See also
CFileItemList

Constructor & Destructor Documentation

◆ CFileItem() [1/24]

CFileItem::CFileItem ( )
default

◆ CFileItem() [2/24]

CFileItem::CFileItem ( const CFileItem & item)

◆ CFileItem() [3/24]

CFileItem::CFileItem ( const CGUIListItem & item)
explicit

◆ CFileItem() [4/24]

CFileItem::CFileItem ( const std::string & strLabel)
explicit

◆ CFileItem() [5/24]

CFileItem::CFileItem ( const char * strLabel)
explicit

◆ CFileItem() [6/24]

CFileItem::CFileItem ( const CURL & path,
bool bIsFolder )

◆ CFileItem() [7/24]

CFileItem::CFileItem ( std::string_view strPath,
bool bIsFolder )

◆ CFileItem() [8/24]

CFileItem::CFileItem ( const CSong & song)
explicit

◆ CFileItem() [9/24]

CFileItem::CFileItem ( const CSong & song,
const MUSIC_INFO::CMusicInfoTag & music )

◆ CFileItem() [10/24]

CFileItem::CFileItem ( const CURL & path,
const CAlbum & album )

◆ CFileItem() [11/24]

CFileItem::CFileItem ( std::string_view path,
const CAlbum & album )

◆ CFileItem() [12/24]

CFileItem::CFileItem ( const CArtist & artist)
explicit

◆ CFileItem() [13/24]

CFileItem::CFileItem ( const CGenre & genre)
explicit

◆ CFileItem() [14/24]

CFileItem::CFileItem ( const MUSIC_INFO::CMusicInfoTag & music)
explicit

◆ CFileItem() [15/24]

CFileItem::CFileItem ( const CVideoInfoTag & movie)
explicit

◆ CFileItem() [16/24]

CFileItem::CFileItem ( const std::shared_ptr< PVR::CPVREpgInfoTag > & tag)
explicit

◆ CFileItem() [17/24]

CFileItem::CFileItem ( const std::shared_ptr< PVR::CPVREpgSearchFilter > & filter)
explicit

◆ CFileItem() [18/24]

CFileItem::CFileItem ( const std::shared_ptr< PVR::CPVRChannelGroupMember > & channelGroupMember)
explicit

◆ CFileItem() [19/24]

CFileItem::CFileItem ( const std::shared_ptr< PVR::CPVRRecording > & record)
explicit

◆ CFileItem() [20/24]

CFileItem::CFileItem ( const std::shared_ptr< PVR::CPVRTimerInfoTag > & timer)
explicit

◆ CFileItem() [21/24]

CFileItem::CFileItem ( const std::string_view path,
const std::shared_ptr< PVR::CPVRProvider > & provider )
explicit

◆ CFileItem() [22/24]

CFileItem::CFileItem ( const CMediaSource & share)
explicit

◆ CFileItem() [23/24]

CFileItem::CFileItem ( const std::shared_ptr< const ADDON::IAddon > & addonInfo)
explicit

◆ CFileItem() [24/24]

CFileItem::CFileItem ( const std::shared_ptr< const IEvent > & eventLogEntry)
explicit

◆ ~CFileItem()

CFileItem::~CFileItem ( )
override

Member Function Documentation

◆ Archive()

void CFileItem::Archive ( CArchive & ar)
overridevirtual

Implements IArchivable.

Reimplemented in CFileItemList.

◆ CanQueue()

bool CFileItem::CanQueue ( ) const

◆ CleanString()

void CFileItem::CleanString ( )

◆ Clone()

CGUIListItem * CFileItem::Clone ( ) const
inlineoverridevirtual

Reimplemented from CGUIListItem.

Reimplemented in CGUIStaticItem.

◆ ContentLookup()

bool CFileItem::ContentLookup ( ) const
inline

Some sources do not support HTTP HEAD request to determine i.e. mime type.

Returns
false if HEAD requests have to be avoided

◆ Exists()

bool CFileItem::Exists ( bool bUseCache = true) const

◆ FillInMimeType()

void CFileItem::FillInMimeType ( bool lookup = true)

Resolve the MIME type based on file extension or a web lookup If m_mimetype is already set (non-empty), this function has no effect. For http:// and shout:// streams, this will query the stream (blocking operation). Set lookup=false to skip any internet lookups and always return immediately.

Todo
adapt this to use CMime::GetMimeType()

◆ FindLocalArt()

std::string CFileItem::FindLocalArt ( const std::string & artFile,
bool useFolder ) const

Assemble the filename of a particular piece of local artwork for an item, and check for file existence.

Parameters
artFilethe art file to search for.
useFolderwhether to look in the folder for the art file. Defaults to false.
Returns
the path to the local artwork if it exists, empty otherwise.
See also
GetLocalArt

◆ GetAddonInfo()

std::shared_ptr< const ADDON::IAddon > CFileItem::GetAddonInfo ( ) const
inline

◆ GetBaseMoviePath()

std::string CFileItem::GetBaseMoviePath ( bool useFolderNames) const

Find the base movie path (i.e. the item the user expects us to use to lookup the movie) For folder items, with "use foldernames for lookups" it returns the folder. Regardless of settings, for VIDEO_TS/BDMV it returns the parent of the VIDEO_TS/BDMV folder (if present)

Parameters
useFolderNameswhether we're using foldernames for lookups
Returns
the base movie folder

◆ GetCurrentResumeTime()

double CFileItem::GetCurrentResumeTime ( ) const

Return the current resume time.

Returns
The time in seconds from the start to resume playing from.

◆ GetCurrentResumeTimeAndPartNumber()

bool CFileItem::GetCurrentResumeTimeAndPartNumber ( int64_t & startOffset,
int & partNumber ) const

Return the current resume time and part.

Parameters
startOffsetwill be filled with the resume time offset in seconds if item has a resume point set, is unchanged otherwise
partNumberwill be filled with the part number if item has a resume point set, is unchanged otherwise
Returns
True if the item has a resume point set, false otherwise.

◆ GetDateTime()

const CDateTime & CFileItem::GetDateTime ( ) const
inline

◆ GetDepth()

int CFileItem::GetDepth ( ) const
inline

◆ GetDriveType()

SourceType CFileItem::GetDriveType ( ) const
inline

◆ GetDVDLabel()

const std::string & CFileItem::GetDVDLabel ( ) const
inline

◆ GetDynPath()

const std::string & CFileItem::GetDynPath ( ) const

◆ GetDynURL()

CURL CFileItem::GetDynURL ( ) const

◆ GetEndOffset()

int64_t CFileItem::GetEndOffset ( ) const
inline

Get the end offset.

Returns
The offset value as ms.

◆ GetEPGInfoTag()

std::shared_ptr< PVR::CPVREpgInfoTag > CFileItem::GetEPGInfoTag ( ) const
inline

◆ GetEPGSearchFilter()

std::shared_ptr< PVR::CPVREpgSearchFilter > CFileItem::GetEPGSearchFilter ( ) const
inline

◆ GetExtraInfo()

const std::string & CFileItem::GetExtraInfo ( ) const
inline

◆ GetGameInfoTag() [1/2]

CGameInfoTag * CFileItem::GetGameInfoTag ( )

◆ GetGameInfoTag() [2/2]

const KODI::GAME::CGameInfoTag * CFileItem::GetGameInfoTag ( ) const
inline

◆ GetItemToPlay()

CFileItem CFileItem::GetItemToPlay ( ) const

return the item to play. will be almost 'this', but can be different (e.g. "Play recording" from PVR EPG grid window)

Returns
the item to play

◆ GetLocalMetadataPath()

std::string CFileItem::GetLocalMetadataPath ( ) const

Get the path where we expect local metadata to reside. For a folder, this is just the existing path (eg tvshow folder) For a file, this is the parent path, with exceptions made for VIDEO_TS and BDMV files.

Three cases are handled:

/foo/bar/movie_name/file_name -> /foo/bar/movie_name/ /foo/bar/movie_name/VIDEO_TS/file_name -> /foo/bar/movie_name/ /foo/bar/movie_name/BDMV/file_name -> /foo/bar/movie_name/

See also
URIUtils::GetParentPath

◆ GetLockInfo() [1/2]

KODI::UTILS::CLockInfo & CFileItem::GetLockInfo ( )
inline

Retrieve item's lock information, like lock code, lock mode, etc.

Returns
The lock information

◆ GetLockInfo() [2/2]

const KODI::UTILS::CLockInfo & CFileItem::GetLockInfo ( ) const
inline

Retrieve item's lock information, like lock code, lock mode, etc.

Returns
The lock information

◆ GetMimeType()

const std::string & CFileItem::GetMimeType ( ) const
inline

◆ GetMovieName()

std::string CFileItem::GetMovieName ( bool bUseFolderNames = false) const

◆ GetMusicInfoTag() [1/2]

MUSIC_INFO::CMusicInfoTag * CFileItem::GetMusicInfoTag ( )

◆ GetMusicInfoTag() [2/2]

const MUSIC_INFO::CMusicInfoTag * CFileItem::GetMusicInfoTag ( ) const
inline

◆ GetPath()

const std::string & CFileItem::GetPath ( ) const
inline

◆ GetPictureInfoTag() [1/2]

CPictureInfoTag * CFileItem::GetPictureInfoTag ( )

◆ GetPictureInfoTag() [2/2]

const CPictureInfoTag * CFileItem::GetPictureInfoTag ( ) const
inline

◆ GetProgramCount()

int CFileItem::GetProgramCount ( ) const
inline

◆ GetPVRChannelGroupMemberInfoTag()

std::shared_ptr< PVR::CPVRChannelGroupMember > CFileItem::GetPVRChannelGroupMemberInfoTag ( ) const
inline

◆ GetPVRChannelInfoTag()

std::shared_ptr< PVR::CPVRChannel > CFileItem::GetPVRChannelInfoTag ( ) const

◆ GetPVRProviderInfoTag()

std::shared_ptr< PVR::CPVRProvider > CFileItem::GetPVRProviderInfoTag ( ) const
inline

◆ GetPVRRecordingInfoTag()

std::shared_ptr< PVR::CPVRRecording > CFileItem::GetPVRRecordingInfoTag ( ) const
inline

◆ GetPVRTimerInfoTag()

std::shared_ptr< PVR::CPVRTimerInfoTag > CFileItem::GetPVRTimerInfoTag ( ) const
inline

◆ GetSize()

int64_t CFileItem::GetSize ( ) const
inline

◆ GetStartOffset()

int64_t CFileItem::GetStartOffset ( ) const
inline

Get the offset where start the playback.

Returns
The offset value as ms. Can return also special value -1, see define STARTOFFSET_RESUME.

◆ GetStartPartNumber()

int CFileItem::GetStartPartNumber ( ) const
inline

◆ GetThumbHideIfUnwatched()

std::string CFileItem::GetThumbHideIfUnwatched ( const CFileItem * item) const

Get the thumb for the item, but hide it to prevent spoilers if the user has set 'Show information for unwatched items' appropriately.

Parameters
itemthe item to get the thumb image for.
Returns
fanart or spoiler overlay if item is an unwatched episode, thumb art otherwise.

◆ GetTitle()

const std::string & CFileItem::GetTitle ( ) const
inline

◆ GetURL()

CURL CFileItem::GetURL ( ) const

◆ GetUserMusicThumb()

std::string CFileItem::GetUserMusicThumb ( bool alwaysCheckRemote = false,
bool fallbackToFolder = false ) const

◆ GetVideoContentType()

VideoDbContentType CFileItem::GetVideoContentType ( ) const

◆ GetVideoInfoTag() [1/2]

CVideoInfoTag * CFileItem::GetVideoInfoTag ( )

◆ GetVideoInfoTag() [2/2]

const CVideoInfoTag * CFileItem::GetVideoInfoTag ( ) const

◆ HasAddonInfo()

bool CFileItem::HasAddonInfo ( ) const
inline

◆ HasCueDocument()

bool CFileItem::HasCueDocument ( ) const

◆ HasEPGInfoTag()

bool CFileItem::HasEPGInfoTag ( ) const
inline

◆ HasEPGSearchFilter()

bool CFileItem::HasEPGSearchFilter ( ) const
inline

◆ HasGameInfoTag()

bool CFileItem::HasGameInfoTag ( ) const
inline

◆ HasMusicInfoTag()

bool CFileItem::HasMusicInfoTag ( ) const
inline

◆ HasPictureInfoTag()

bool CFileItem::HasPictureInfoTag ( ) const
inline

◆ HasPVRChannelGroupMemberInfoTag()

bool CFileItem::HasPVRChannelGroupMemberInfoTag ( ) const
inline

◆ HasPVRChannelInfoTag()

bool CFileItem::HasPVRChannelInfoTag ( ) const

◆ HasPVRProviderInfoTag()

bool CFileItem::HasPVRProviderInfoTag ( ) const
inline

◆ HasPVRRecordingInfoTag()

bool CFileItem::HasPVRRecordingInfoTag ( ) const
inline

◆ HasPVRTimerInfoTag()

bool CFileItem::HasPVRTimerInfoTag ( ) const
inline

◆ HasVideoExtras()

bool CFileItem::HasVideoExtras ( ) const

◆ HasVideoInfoTag()

bool CFileItem::HasVideoInfoTag ( ) const

◆ HasVideoVersions()

bool CFileItem::HasVideoVersions ( ) const

◆ IsAddonsPath()

bool CFileItem::IsAddonsPath ( ) const

◆ IsAlbum()

bool CFileItem::IsAlbum ( ) const

◆ IsAndroidApp()

bool CFileItem::IsAndroidApp ( ) const

◆ IsAPK()

bool CFileItem::IsAPK ( ) const

◆ IsBluray()

bool CFileItem::IsBluray ( ) const

◆ IsCBR()

bool CFileItem::IsCBR ( ) const

◆ IsCBZ()

bool CFileItem::IsCBZ ( ) const

◆ IsDeleted()

bool CFileItem::IsDeleted ( ) const

Check whether an item is 'deleted' (for example, a trashed pvr recording).

Returns
true if item is 'deleted', false otherwise.

◆ IsDeletedPVRRecording()

bool CFileItem::IsDeletedPVRRecording ( ) const

◆ IsDiscImage()

bool CFileItem::IsDiscImage ( ) const

◆ IsDVD()

bool CFileItem::IsDVD ( ) const

◆ IsEPG()

bool CFileItem::IsEPG ( ) const

◆ IsFavourite()

bool CFileItem::IsFavourite ( ) const

◆ IsFileFolder()

bool CFileItem::IsFileFolder ( FileFolderType types = FileFolderType::MASK_ALL) const

◆ IsFileItem()

bool CFileItem::IsFileItem ( ) const
inlineoverridevirtual

Reimplemented from CGUIListItem.

◆ IsGame()

bool CFileItem::IsGame ( ) const

◆ IsHD()

bool CFileItem::IsHD ( ) const

◆ IsInProgressPVRRecording()

bool CFileItem::IsInProgressPVRRecording ( ) const

◆ IsISO9660()

bool CFileItem::IsISO9660 ( ) const

◆ IsLabelPreformatted()

bool CFileItem::IsLabelPreformatted ( ) const
inline

◆ IsLibraryFolder()

bool CFileItem::IsLibraryFolder ( ) const

◆ IsLiveTV()

bool CFileItem::IsLiveTV ( ) const

◆ IsMultiPath()

bool CFileItem::IsMultiPath ( ) const

◆ IsNFO()

bool CFileItem::IsNFO ( ) const

◆ IsNfs()

bool CFileItem::IsNfs ( ) const

◆ IsOnDVD()

bool CFileItem::IsOnDVD ( ) const

◆ IsOpticalMediaFile()

bool CFileItem::IsOpticalMediaFile ( ) const

◆ IsParentFolder()

bool CFileItem::IsParentFolder ( ) const

◆ IsPath()

bool CFileItem::IsPath ( const std::string & path,
bool ignoreURLOptions = false ) const

◆ IsPicture()

bool CFileItem::IsPicture ( ) const

Check whether an item is a picture item. Note that this returns true for anything with a picture info tag, so that may include eg. folders.

Returns
true if item is picture, false otherwise.

◆ IsPlugin()

bool CFileItem::IsPlugin ( ) const

◆ IsPVR()

bool CFileItem::IsPVR ( ) const

◆ IsPVRChannel()

bool CFileItem::IsPVRChannel ( ) const

◆ IsPVRChannelGroup()

bool CFileItem::IsPVRChannelGroup ( ) const

◆ IsPVRProvider()

bool CFileItem::IsPVRProvider ( ) const

◆ IsPVRRecording()

bool CFileItem::IsPVRRecording ( ) const

◆ IsPVRTimer()

bool CFileItem::IsPVRTimer ( ) const

◆ IsPythonScript()

bool CFileItem::IsPythonScript ( ) const

◆ IsRAR()

bool CFileItem::IsRAR ( ) const

◆ IsReadOnly()

bool CFileItem::IsReadOnly ( ) const

◆ IsRemovable()

bool CFileItem::IsRemovable ( ) const

◆ IsResumable()

bool CFileItem::IsResumable ( ) const

Test if this item type can be resumed.

Returns
True if this item is a folder and has at least one child with a partway resume bookmark or at least one unwatched child or if it is not a folder, if it has a partway resume bookmark, false otherwise.

◆ IsResumePointSet()

bool CFileItem::IsResumePointSet ( ) const

Test if this item has a valid resume point set.

Returns
True if this item has a resume point and it is set, false otherwise.

◆ IsRSS()

bool CFileItem::IsRSS ( ) const

◆ IsSamePath()

bool CFileItem::IsSamePath ( const CFileItem * item) const

◆ IsScript()

bool CFileItem::IsScript ( ) const

◆ IsShareOrDrive()

bool CFileItem::IsShareOrDrive ( ) const
inline

◆ IsSmb()

bool CFileItem::IsSmb ( ) const

◆ IsSourcesPath()

bool CFileItem::IsSourcesPath ( ) const

◆ IsStack()

bool CFileItem::IsStack ( ) const

◆ IsType()

bool CFileItem::IsType ( const char * ext) const

◆ IsURL() [1/2]

bool CFileItem::IsURL ( ) const

◆ IsURL() [2/2]

bool CFileItem::IsURL ( const CURL & url) const

◆ IsUsablePVRRecording()

bool CFileItem::IsUsablePVRRecording ( ) const

◆ IsVirtualDirectoryRoot()

bool CFileItem::IsVirtualDirectoryRoot ( ) const

◆ IsZIP()

bool CFileItem::IsZIP ( ) const

◆ LoadDetails()

bool CFileItem::LoadDetails ( )

Load detailed data for an item constructed with only a path and a folder flag Fills item's video info tag, sets item properties.

Returns
true on success, false otherwise.
Todo
add support for other types on demand.

◆ LoadEmbeddedCue()

void CFileItem::LoadEmbeddedCue ( )

◆ LoadGameTag()

bool CFileItem::LoadGameTag ( )

◆ LoadMusicTag()

bool CFileItem::LoadMusicTag ( )

◆ LoadTracksFromCueDocument()

bool CFileItem::LoadTracksFromCueDocument ( CFileItemList & scannedItems)

◆ MergeInfo()

void CFileItem::MergeInfo ( const CFileItem & item)

Merge an item with information from another item We take metadata/art information from the given item and supplement the current item with that info. If tags exist in the new item we only merge the missing tag information. Properties are appended, and labels are updated if non-empty in the given item.

◆ operator=()

CFileItem & CFileItem::operator= ( const CFileItem & item)

◆ RemoveExtension()

void CFileItem::RemoveExtension ( )

◆ Serialize()

void CFileItem::Serialize ( CVariant & value) const
overridevirtual

Implements ISerializable.

◆ SetCanQueue()

void CFileItem::SetCanQueue ( bool bYesNo)

◆ SetContentLookup()

void CFileItem::SetContentLookup ( bool enable)
inline

Lookup via HTTP HEAD request might not be needed, use this setter to disable ContentLookup.

◆ SetCueDocument()

void CFileItem::SetCueDocument ( const std::shared_ptr< CCueDocument > & cuePtr)

◆ SetDateTime() [1/4]

void CFileItem::SetDateTime ( const CDateTime & dateTime)
inline

◆ SetDateTime() [2/4]

void CFileItem::SetDateTime ( KODI::TIME::FileTime dateTime)
inline

◆ SetDateTime() [3/4]

void CFileItem::SetDateTime ( KODI::TIME::SystemTime dateTime)
inline

◆ SetDateTime() [4/4]

void CFileItem::SetDateTime ( time_t dateTime)
inline

◆ SetDepth()

void CFileItem::SetDepth ( int depth)
inline

◆ SetDriveType()

void CFileItem::SetDriveType ( SourceType driveType)
inline

◆ SetDVDLabel()

void CFileItem::SetDVDLabel ( std::string_view label)
inline

◆ SetDynPath()

void CFileItem::SetDynPath ( std::string_view path)

◆ SetDynURL()

void CFileItem::SetDynURL ( const CURL & url)

◆ SetEndOffset()

void CFileItem::SetEndOffset ( const int64_t offset)
inline

Set the end offset.

Parameters
offsetSet the offset as ms.

◆ SetExtraInfo()

void CFileItem::SetExtraInfo ( std::string_view info)
inline

◆ SetFileSizeLabel()

void CFileItem::SetFileSizeLabel ( )

◆ SetFromAlbum()

void CFileItem::SetFromAlbum ( const CAlbum & album)

Sets details using the information from the CAlbum object Sets the album in the music info tag and uses its information to set the label and album-specific properties.

Parameters
albumalbum details to use and set

◆ SetFromMusicInfoTag()

void CFileItem::SetFromMusicInfoTag ( const MUSIC_INFO::CMusicInfoTag & music)

Sets details using the information from the CMusicInfoTag object Sets the musicinfotag and uses its information to set the label and path.

Parameters
musicmusic details to use and set

◆ SetFromSong()

void CFileItem::SetFromSong ( const CSong & song)

Sets details using the information from the CSong object Sets the song in the music info tag and uses its information to set the label, path, song-specific properties and artwork.

Parameters
songsong details to use and set

◆ SetFromVideoInfoTag()

void CFileItem::SetFromVideoInfoTag ( const CVideoInfoTag & video)

Sets details using the information from the CVideoInfoTag object Sets the videoinfotag and uses its information to set the label and path.

Parameters
videovideo details to use and set

◆ SetIsShareOrDrive()

void CFileItem::SetIsShareOrDrive ( bool set)
inline

◆ SetLabel()

void CFileItem::SetLabel ( const std::string & strLabel)
overridevirtual

Reimplemented from CGUIListItem.

◆ SetLabelPreformatted()

void CFileItem::SetLabelPreformatted ( bool bYesNo)
inline

◆ SetMimeType()

void CFileItem::SetMimeType ( std::string_view mimetype)
inline

◆ SetMimeTypeForInternetFile()

void CFileItem::SetMimeTypeForInternetFile ( )

(Re)set the mime-type for internet files if allowed (m_doContentLookup) Some sources do not support HTTP HEAD request to determine i.e. mime type

◆ SetPath()

void CFileItem::SetPath ( std::string_view path)
inline

◆ SetProgramCount()

void CFileItem::SetProgramCount ( int count)
inline

◆ SetSize()

void CFileItem::SetSize ( int64_t size)
inline

◆ SetSpecialSort()

void CFileItem::SetSpecialSort ( SortSpecial sort)
inline

◆ SetStartOffset()

void CFileItem::SetStartOffset ( const int64_t offset)
inline

Set the offset where start the playback.

Parameters
offsetSet the offset value as ms, or the special value STARTOFFSET_RESUME.

◆ SetStartPartNumber()

void CFileItem::SetStartPartNumber ( int number)
inline

◆ SetTitle()

void CFileItem::SetTitle ( std::string_view title)
inline

◆ SetURL()

void CFileItem::SetURL ( const CURL & url)
Todo
Ideally this (and SetPath) would not be available outside of construction for CFileItem objects, or at least restricted to essentially be equivalent to construction. This would require re-formulating a bunch of CFileItem construction, and also allowing CFileItemList to have its own (public) SetURL() function, so for now we give direct access.

◆ SkipLocalArt()

bool CFileItem::SkipLocalArt ( ) const

Whether or not to skip searching for local art.

Returns
true if local art should be skipped for this item, false otherwise.
See also
GetLocalArt, FindLocalArt

◆ SortsOnBottom()

bool CFileItem::SortsOnBottom ( ) const
inline

◆ SortsOnTop()

bool CFileItem::SortsOnTop ( ) const
inline

◆ ToSortable() [1/2]

void CFileItem::ToSortable ( SortItem & sortable,
const Fields & fields ) const

◆ ToSortable() [2/2]

void CFileItem::ToSortable ( SortItem & sortable,
Field field ) const
overridevirtual

Implements ISortable.

◆ UpdateInfo()

void CFileItem::UpdateInfo ( const CFileItem & item,
bool replaceLabels = true )

Update an item with information from another item We take metadata information from the given item and supplement the current item with that info. If tags exist in the new item we use the entire tag information. Properties are appended, and labels, thumbnail and icon are updated if non-empty in the given item.

Parameters
itemthe item used to supplement information
replaceLabelswhether to replace labels (defaults to true)
Todo
premiered info is normally stored in m_dateTime by the db

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