public class OStringStream extends OStream
ostringstream
.
The C++ ostringstream
('output string stream class')
provides an interface to manipulating strings as if they were output
streams. This class class, OStringStream
, wraps the
ostringstream
and provides an OStream
interface to it.
This class may be useful because some libSBML methods accept an argument
for indicating where to send text string output. An example is the
SBMLDocument.printErrors(OStream stream)
method. The methods use
C++ style streams and not Java stream objects. The OStream
object
exists to bridge the Java and underlying native implementation. It is a
simple wrapper around the underlying stream object and provides a few
basic methods for manipulating it.
Constructor and Description |
---|
OStringStream()
Creates a new
OStringStream object |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Explicitly deletes the underlying native object.
|
String |
str()
Returns the copy of the string object currently assosiated
with this
ostringstream buffer. |
void |
str(String s)
Sets string
s to the string object currently assosiated with
this stream buffer. |
endl, get_ostream
public OStringStream()
OStringStream
objectpublic void delete()
In general, application software will not need to call this method directly. The Java language binding for libSBML is implemented as a language wrapper that provides a Java interface to libSBML's underlying C++/C code. Some of the Java methods return objects that are linked to objects created not by Java code, but by C++ code. The Java objects wrapped around them will be deleted when the garbage collector invokes the corresponding C++ finalize()
methods for the objects. The finalize()
methods in turn call the OStringStream.delete()
method on the libSBML object.
This method is exposed in case calling programs want to ensure that the underlying object is freed immediately, and not at some arbitrary time determined by the Java garbage collector. In normal usage, callers do not need to invoke OStringStream.delete()
themselves.
public String str()
ostringstream
buffer.