Added File::Open(path, mode)
Former-commit-id: 7bd80f04e5f902e9752b1f5091ac55cdf2bc432a
This commit is contained in:
parent
e16e3658f1
commit
fc970c503a
|
|
@ -78,6 +78,7 @@ class NAZARA_API NzFile : public NzHashable, public NzInputStream, NzNonCopyable
|
||||||
bool IsOpen() const;
|
bool IsOpen() const;
|
||||||
|
|
||||||
bool Open(unsigned long openMode = Current);
|
bool Open(unsigned long openMode = Current);
|
||||||
|
bool Open(const NzString& filePath, unsigned long openMode = Current);
|
||||||
|
|
||||||
std::size_t Read(void* buffer, std::size_t size);
|
std::size_t Read(void* buffer, std::size_t size);
|
||||||
std::size_t Read(void* buffer, std::size_t typeSize, unsigned int count);
|
std::size_t Read(void* buffer, std::size_t typeSize, unsigned int count);
|
||||||
|
|
|
||||||
|
|
@ -49,8 +49,7 @@ m_endianness(nzEndianness_Unknown),
|
||||||
m_impl(nullptr),
|
m_impl(nullptr),
|
||||||
m_openMode(0)
|
m_openMode(0)
|
||||||
{
|
{
|
||||||
SetFile(filePath);
|
Open(filePath, openMode);
|
||||||
Open(openMode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NzFile::NzFile(NzFile&& file) noexcept :
|
NzFile::NzFile(NzFile&& file) noexcept :
|
||||||
|
|
@ -313,6 +312,16 @@ bool NzFile::Open(unsigned long openMode)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool NzFile::Open(const NzString& filePath, unsigned long openMode)
|
||||||
|
{
|
||||||
|
NazaraLock(m_mutex)
|
||||||
|
|
||||||
|
Close();
|
||||||
|
|
||||||
|
SetFile(filePath);
|
||||||
|
return Open(openMode);
|
||||||
|
}
|
||||||
|
|
||||||
bool NzFile::SetCursorPos(CursorPosition pos, nzInt64 offset)
|
bool NzFile::SetCursorPos(CursorPosition pos, nzInt64 offset)
|
||||||
{
|
{
|
||||||
NazaraLock(m_mutex)
|
NazaraLock(m_mutex)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue