Version: 2.9.4
Public Member Functions
wxStdInputStreamBuffer Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/stdstream.h>


Detailed Description

wxStdInputStreamBuffer is a std::streambuf derived stream buffer which reads from a wxInputStream.

例:

    wxFFileInputStream file("input.txt.gz");
    wxZlibInputStream gzipInput(file, wxZLIB_GZIP);
    wxStdInputStreamBuffer gzipStreamBuffer(gzipInput);

    // redirect std::cin to read from compressed file
    std::streambuf* streamBufferOld = std::cin.rdbuf(&gzipStreamBuffer);

    // prompt for integer
    int number;
    std::cout << "Enter an integer: " << std::flush;
    std::cin >> number;
    std::cout << std::endl;
    std::cout << "You entered the integer " << number << "." << std::endl;

    // restore std::cin
    std::cin.rdbuf(streamBufferOld);

Library:  wxBase
Category:  Streams
参照:
wxInputStream, wxStdInputStream

Public Member Functions

 wxStdInputStreamBuffer (wxInputStream &stream)
 Creates a std::steambuf derived stream buffer which reads from a wxInputStream.
virtual ~wxStdInputStreamBuffer ()
 Destructor.

List of all members.


Constructor & Destructor Documentation

wxStdInputStreamBuffer::wxStdInputStreamBuffer ( wxInputStream stream)

Creates a std::steambuf derived stream buffer which reads from a wxInputStream.

Parameters:
streamStream to read from.
virtual wxStdInputStreamBuffer::~wxStdInputStreamBuffer ( ) [inline, virtual]

Destructor.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines