wxTextInputStream::wxTextInputStream(wxInputStream &s, const wxString &sep, const wxMBConv& conv) : m_input(s), m_separators(sep), m_conv(conv.Clone()) { memset((void*)m_lastBytes, 0, 10); }
wxDataInputStream::wxDataInputStream(wxInputStream& s, const wxMBConv& conv) : m_input(&s), m_be_order(false), m_conv(conv.Clone()) #else wxDataInputStream::wxDataInputStream(wxInputStream& s) : m_input(&s), m_be_order(false) #endif { } wxDataInputStream::~wxDataInputStream() { #if wxUSE_UNICODE delete m_conv; #endif // wxUSE_UNICODE } #if wxUSE_UNICODE void wxDataInputStream::SetConv( const wxMBConv &conv ) { delete m_conv; m_conv = conv.Clone(); }
wxDataStreamBase::wxDataStreamBase(const wxMBConv& conv) #if wxUSE_UNICODE : m_conv(conv.Clone()) #endif // wxUSE_UNICODE { // It is unused in non-Unicode build, so suppress a warning there. wxUnusedVar(conv); m_be_order = false; // For compatibility with the existing data files, we use extended // precision if it is available, i.e. if wxUSE_APPLE_IEEE is on. #if wxUSE_APPLE_IEEE m_useExtendedPrecision = true; #endif // wxUSE_APPLE_IEEE }
wxDataInputStream::wxDataInputStream(wxInputStream& s, const wxMBConv& conv) : m_input(&s), m_be_order(false), m_conv(conv.Clone()) #else wxDataInputStream::wxDataInputStream(wxInputStream& s) : m_input(&s), m_be_order(false) #endif { } wxDataInputStream::~wxDataInputStream() { #if wxUSE_UNICODE delete m_conv; #endif // wxUSE_UNICODE } #if wxHAS_INT64 wxUint64 wxDataInputStream::Read64() { wxUint64 tmp; Read64(&tmp, 1); return tmp; } #endif // wxHAS_INT64 wxUint32 wxDataInputStream::Read32() { wxUint32 i32; m_input->Read(&i32, 4); if (m_be_order) return wxUINT32_SWAP_ON_LE(i32); else return wxUINT32_SWAP_ON_BE(i32); } wxUint16 wxDataInputStream::Read16() { wxUint16 i16; m_input->Read(&i16, 2); if (m_be_order) return wxUINT16_SWAP_ON_LE(i16); else return wxUINT16_SWAP_ON_BE(i16); } wxUint8 wxDataInputStream::Read8() { wxUint8 buf; m_input->Read(&buf, 1); return (wxUint8)buf; } double wxDataInputStream::ReadDouble() { #if wxUSE_APPLE_IEEE char buf[10]; m_input->Read(buf, 10); return ConvertFromIeeeExtended((const wxInt8 *)buf); #else return 0.0; #endif }
void wxDataStreamBase::SetConv( const wxMBConv &conv ) { delete m_conv; m_conv = conv.Clone(); }