#pragma hdrstop
#endif
-#if wxUSE_BACKINGFILE
+#if wxUSE_FILESYSTEM
-#include "wx/fileback.h"
+#include "wx/private/fileback.h"
#ifndef WX_PRECOMP
#include "wx/utils.h"
{
}
+wxFileOffset wxBackedInputStream::GetLength() const
+{
+ return m_backer.m_impl->GetLength();
+}
+
+wxFileOffset wxBackedInputStream::FindLength() const
+{
+ wxFileOffset len = GetLength();
+
+ if (len == wxInvalidOffset && IsOk()) {
+ // read a byte at 7ff...ffe
+ wxFileOffset pos = 1;
+ pos <<= sizeof(pos) * 8 - 1;
+ pos = ~pos - 1;
+ char ch;
+ size_t size = 1;
+ m_backer.m_impl->ReadAt(pos, &ch, &size);
+ len = GetLength();
+ }
+
+ return len;
+}
+
size_t wxBackedInputStream::OnSysRead(void *buffer, size_t size)
{
if (!IsOk())
return size;
}
-wxFileOffset wxBackedInputStream::GetLength() const
-{
- return m_backer.m_impl->GetLength();
-}
-
wxFileOffset wxBackedInputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode)
{
switch (mode) {
return m_pos;
}
-#endif // wxUSE_BACKINGFILE
+#endif // wxUSE_FILESYSTEM