if (file.IsOpened())
{
wxString contents;
-#if wxUSE_UNICODE
- wxMemoryBuffer buffer;
-#else
- wxString buffer;
-#endif
off_t len = file.Length();
if (len > 0)
{
- void *bufptr = buffer.GetWriteBuf(len);
- success = (file.Read(bufptr, len) == len);
- buffer.UngetWriteBuf(len);
#if wxUSE_UNICODE
+ wxMemoryBuffer buffer(len);
+ success = (file.Read(buffer.GetData(), len) == len);
contents = wxString(buffer, *wxConvCurrent);
#else
+ wxString buffer;
+ success = (file.Read(wxStringBuffer(buffer, len), len) == len);
contents = buffer;
#endif
}
if (file.IsOpened())
{
wxString contents;
-#if wxUSE_UNICODE
- wxMemoryBuffer buffer;
-#else
- wxString buffer;
-#endif
off_t len = file.Length();
if (len > 0)
{
- void *bufptr = buffer.GetWriteBuf(len);
- success = (file.Read(bufptr, len) == len);
- buffer.UngetWriteBuf(len);
#if wxUSE_UNICODE
+ wxMemoryBuffer buffer(len);
+ success = (file.Read(buffer.GetData(), len) == len);
contents = wxString(buffer, *wxConvCurrent);
#else
+ wxString buffer;
+ success = (file.Read(wxStringBuffer(buffer, len), len) == len);
contents = buffer;
#endif
}
if (file.IsOpened())
{
wxString contents;
-#if wxUSE_UNICODE
- wxMemoryBuffer buffer;
-#else
- wxString buffer;
-#endif
off_t len = file.Length();
if (len > 0)
{
- void *bufptr = buffer.GetWriteBuf(len);
- success = (file.Read(bufptr, len) == len);
- buffer.UngetWriteBuf(len);
#if wxUSE_UNICODE
+ wxMemoryBuffer buffer(len);
+ success = (file.Read(buffer.GetData(), len) == len);
contents = wxString(buffer, *wxConvCurrent);
#else
+ wxString buffer;
+ success = (file.Read(wxStringBuffer(buffer, len), len) == len);
contents = buffer;
#endif
}
if (file.IsOpened())
{
wxString contents;
-#if wxUSE_UNICODE
- wxMemoryBuffer buffer;
-#else
- wxString buffer;
-#endif
off_t len = file.Length();
if (len > 0)
{
- void *bufptr = buffer.GetWriteBuf(len);
- success = (file.Read(bufptr, len) == len);
- buffer.UngetWriteBuf(len);
#if wxUSE_UNICODE
+ wxMemoryBuffer buffer(len);
+ success = (file.Read(buffer.GetData(), len) == len);
contents = wxString(buffer, *wxConvCurrent);
#else
+ wxString buffer;
+ success = (file.Read(wxStringBuffer(buffer, len), len) == len);
contents = buffer;
#endif
}