This is a combination of running clang-tidy with modernize-use-nullptr check for some ports (GTK, X11, OSX) and manual changes to the ports for which it couldn't be used easily (MSW, DFB) and also manually updating the docs. Also replace NULL with null or nullptr in the comments as this is more consistent with the use of nullptr in the code and makes it simpler to grep for the remaining occurrences of NULL itself. And also use null in the assert messages. Only a few occurrences of "NULL" are still left in non-C files, mostly corresponding to unclear comments or string output which it might not be safe to change.
72 lines
2.4 KiB
Objective-C
72 lines
2.4 KiB
Objective-C
/////////////////////////////////////////////////////////////////////////////
|
|
// Name: sstream.h
|
|
// Purpose: interface of wxStringInputStream
|
|
// Author: wxWidgets team
|
|
// Licence: wxWindows licence
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
/**
|
|
@class wxStringInputStream
|
|
|
|
This class implements an input stream which reads data from a string.
|
|
It supports seeking.
|
|
|
|
@library{wxbase}
|
|
@category{streams}
|
|
*/
|
|
class wxStringInputStream : public wxInputStream
|
|
{
|
|
public:
|
|
/**
|
|
Creates a new read-only stream using the specified string.
|
|
|
|
Note that the string is copied by the stream so if the original string is
|
|
modified after using this constructor, changes to it are not reflected
|
|
when reading from stream.
|
|
*/
|
|
wxStringInputStream(const wxString& s);
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
@class wxStringOutputStream
|
|
|
|
This class implements an output stream which writes data either to a
|
|
user-provided or internally allocated string.
|
|
|
|
Note that currently this stream does not support seeking but can tell
|
|
its current position.
|
|
|
|
@library{wxbase}
|
|
@category{streams}
|
|
*/
|
|
class wxStringOutputStream : public wxOutputStream
|
|
{
|
|
public:
|
|
/**
|
|
Construct a new stream object writing the data to a string.
|
|
|
|
If the provided pointer is non-null, data will be written to it.
|
|
Otherwise, an internal string is used for the data written to this
|
|
stream, use GetString() to get access to it.
|
|
|
|
If @a str is used, data written to the stream is appended to the current
|
|
contents of it, i.e. the string is not cleared here. However if it is not
|
|
empty, the positions returned by wxOutputStream::TellO will be offset by
|
|
the initial string length, i.e. initial stream position will be the
|
|
initial length of the string and not 0.
|
|
|
|
Notice that the life time of @a conv must be greater than the life time
|
|
of this object itself as it stores a reference to it. Also notice that
|
|
with default value of this argument the data written to the stream must
|
|
be valid UTF-8, pass @c wxConvISO8859_1 to deal with arbitrary 8 bit data.
|
|
*/
|
|
explicit wxStringOutputStream(wxString* pString = nullptr, wxMBConv& conv = wxConvUTF8);
|
|
|
|
/**
|
|
Returns the string containing all the data written to the stream so far.
|
|
*/
|
|
const wxString& GetString() const;
|
|
};
|
|
|