:: com :: sun :: star :: io ::
|
interface XTextInputStream |
- Base Interfaces
XTextInputStream
┗ XInputStream
XInputStream |
- (referenced interface's summary:)
- This is the basic interface to read data from a stream.
|
|
- Description
- Interface to read strings from a stream.
This interfaces allows to read strings seperated by
delimiters and to read lines. The character encoding
to be used can be set by setEncoding().
Default encoding is "utf8".
|
Methods' Summary |
readLine |
reads text until a line break (CR, LF, or CR/LF) or
EOF is found and returns it as string (without CR, LF).
|
readString |
reads text until one of the given delimiter characters
or EOF is found and returns it as string (without delimiter).
|
isEOF |
Returns the EOF status.
|
setEncoding |
sets character encoding.
|
Methods' Details |
readLine
- Description
- 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.
- See also
- setEncoding, isEOF
|
|
readString
string |
readString( |
[in] sequence< char > |
Delimiters, |
| [in] boolean |
bRemoveDelimiter ) |
raises( |
IOException ); |
- Description
- 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.
- See also
- setEncoding, isEOF
|
|
isEOF
- Description
- 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).
- Returns
- true, if the end of file is reached, so that
no next string can be read. false otherwise
|
|
setEncoding
void |
setEncoding( |
[in] string |
Encoding ); |
- Description
- sets character encoding.
- Parameter 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.
|
|
Top of Page
Copyright © 2000, 2013 LibreOffice contributors and/or their affiliates. All rights reserved.
LibreOffice was created by The Document Foundation, based on OpenOffice.org, which is Copyright 2000, 2010 Oracle and/or its affiliates.
The Document Foundation acknowledges all community members, please find more info at our website.
Privacy Policy | Impressum (Legal Info) | Copyright information: The source code of LibreOffice is licensed under the GNU Lesser General Public License (LGPLv3). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.