Support 'file://' protocol prefix
This commit is contained in:
parent
b47705ff81
commit
ed9939dc74
|
@ -1,6 +1,9 @@
|
|||
#include "./basicfileinfo.h"
|
||||
|
||||
#include <c++utilities/conversion/stringconversion.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace ConversionUtilities;
|
||||
|
||||
/*!
|
||||
* \namespace Media
|
||||
|
@ -59,7 +62,8 @@ void BasicFileInfo::open(bool readOnly)
|
|||
void BasicFileInfo::reopen(bool readOnly)
|
||||
{
|
||||
invalidated();
|
||||
m_file.open(m_path, (m_readOnly = readOnly) ? ios_base::in | ios_base::binary : ios_base::in | ios_base::out | ios_base::binary);
|
||||
m_file.open(startsWith(m_path, "file:/") ? m_path.data() + 6 : m_path.data(),
|
||||
(m_readOnly = readOnly) ? ios_base::in | ios_base::binary : ios_base::in | ios_base::out | ios_base::binary);
|
||||
m_file.seekg(0, ios_base::end);
|
||||
m_size = static_cast<uint64>(m_file.tellg());
|
||||
m_file.seekg(0, ios_base::beg);
|
||||
|
|
Loading…
Reference in New Issue