LibreOffice
LibreOffice 24.2 SDK API Reference
|
Interface to read strings from a stream. More...
import"XTextInputStream.idl";
Public Member Functions | |
string | readLine () raises ( com::sun::star::io::IOException ) |
reads text until a line break (CR, LF, or CR/LF) or EOF is found and returns it as string (without CR, LF). More... | |
string | readString ([in] sequence< char > Delimiters, [in] boolean bRemoveDelimiter) raises ( com::sun::star::io::IOException ) |
reads text until one of the given delimiter characters or EOF is found and returns it as string (without delimiter). More... | |
boolean | isEOF () raises ( com::sun::star::io::IOException ) |
Returns the EOF status. More... | |
void | setEncoding ([in] string Encoding) |
sets character encoding. More... | |
Public Member Functions inherited from XInputStream | |
long | readBytes ([out] sequence< byte > aData, [in] long nBytesToRead) raises ( com::sun::star::io::NotConnectedException, com::sun::star::io::BufferSizeExceededException, com::sun::star::io::IOException) |
reads the specified number of bytes in the given sequence. More... | |
long | readSomeBytes ([out] sequence< byte > aData, [in] long nMaxBytesToRead) raises ( com::sun::star::io::NotConnectedException, com::sun::star::io::BufferSizeExceededException, com::sun::star::io::IOException ) |
reads the available number of bytes, at maximum nMaxBytesToRead. More... | |
void | skipBytes ([in] long nBytesToSkip) raises ( com::sun::star::io::NotConnectedException, com::sun::star::io::BufferSizeExceededException, com::sun::star::io::IOException ) |
skips the next nBytesToSkip bytes (must be positive). More... | |
long | available () raises ( com::sun::star::io::NotConnectedException, com::sun::star::io::IOException ) |
states how many bytes can be read or skipped without blocking. More... | |
void | closeInput () raises ( com::sun::star::io::NotConnectedException, com::sun::star::io::IOException) |
closes the stream. More... | |
Public Member Functions inherited from XInterface | |
any | queryInterface ([in] type aType) |
queries for a new interface to an existing UNO object. More... | |
void | acquire () |
increases the reference counter by one. More... | |
void | release () |
decreases the reference counter by one. More... | |
Interface to read strings from a stream.
This interfaces allows to read strings separated by delimiters and to read lines. The character encoding to be used can be set by setEncoding(). Default encoding is "utf8".
boolean isEOF | ( | ) | ||
raises | ( | com::sun::star::io::IOException | ||
) |
Returns the EOF status.
This method has to be used to detect if the end of the stream is reached.
Important: This cannot be detected by asking for an empty string because that can be a valid return value of readLine() (if the line is empty) and readString() (if a delimiter is directly followed by the next one).
TRUE
, if the end of file is reached, so that no next string can be read. FALSE
otherwise string readLine | ( | ) | ||
raises | ( | com::sun::star::io::IOException | ||
) |
reads text until a line break (CR, LF, or CR/LF) or EOF is found and returns it as string (without CR, LF).
The read characters are converted according to the encoding defined by setEncoding(). If EOF is already reached before calling this method an empty string is returned.
string readString | ( | [in] sequence< char > | Delimiters, |
[in] boolean | bRemoveDelimiter | ||
) | |||
raises | ( | com::sun::star::io::IOException | |
) |
reads text until one of the given delimiter characters or EOF is found and returns it as string (without delimiter).
Important: CR/LF is not used as default delimiter! So if no delimiter is defined or none of the delimiters is found, the stream will be read to EOF. The read characters are converted according to the encoding defined by setEncoding(). If EOF is already reached before calling this method an empty string is returned.
void setEncoding | ( | [in] string | Encoding | ) |
sets character encoding.
Encoding | sets the character encoding that should be used. The character encoding names refer to the document http://www.iana.org/assignments/character-sets. Which character sets are supported depends on the implementation. |