Commit ce3c013f authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

IFile: Add an isMain helper

Refs #29
parent b58a1139
......@@ -73,6 +73,12 @@ public:
* If the file is external, this is a best guess effort.
*/
virtual bool isNetwork() const = 0;
/**
* @brief isMain Returns true if this file is the main file of a media
*
* This can be used to have a Disc file considered as the main file
*/
virtual bool isMain() const = 0;
};
}
......@@ -172,6 +172,11 @@ bool File::isNetwork() const
return m_isNetwork;
}
bool File::isMain() const
{
return m_type == Type::Main;
}
std::shared_ptr<Media> File::media() const
{
if ( m_mediaId == 0 )
......
......@@ -63,6 +63,7 @@ public:
bool updateFsInfo( uint32_t newLastModificationDate, uint32_t newSize );
virtual bool isRemovable() const override;
virtual bool isNetwork() const override;
virtual bool isMain() const override;
std::shared_ptr<Media> media() const;
bool destroy();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment