LibreOffice Module oox (master) 1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
oox::TextInputStream Class Reference

#include <textinputstream.hxx>

Public Member Functions

 TextInputStream (const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::io::XInputStream > &rxInStrm, rtl_TextEncoding eTextEnc)
 
 TextInputStream (const css::uno::Reference< css::uno::XComponentContext > &rxContext, BinaryInputStream &rInStrm, rtl_TextEncoding eTextEnc)
 
 ~TextInputStream ()
 
bool isEof () const
 Returns true, if no more text is available in the stream. More...
 
OUString readLine ()
 Reads a text line from the stream. More...
 
OUString readToChar (sal_Unicode cChar, bool bIncludeChar)
 Reads a text portion from the stream until the specified character is found. More...
 

Static Public Member Functions

static css::uno::Reference< css::io::XTextInputStream2 > createXTextInputStream (const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::io::XInputStream > &rxInStrm, rtl_TextEncoding eTextEnc)
 Creates a UNO text input stream object from the passed UNO input stream. More...
 

Private Member Functions

void init (const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::io::XInputStream > &rxInStrm, rtl_TextEncoding eTextEnc)
 
OUString createFinalString (const OUString &rString)
 Adds the pending character in front of the passed string, if existing. More...
 

Private Attributes

css::uno::Reference< css::io::XTextInputStream2 > mxTextStrm
 
sal_Unicode mcPendingChar
 

Detailed Description

Definition at line 39 of file textinputstream.hxx.

Constructor & Destructor Documentation

◆ TextInputStream() [1/2]

oox::TextInputStream::TextInputStream ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
const css::uno::Reference< css::io::XInputStream > &  rxInStrm,
rtl_TextEncoding  eTextEnc 
)
explicit

◆ TextInputStream() [2/2]

oox::TextInputStream::TextInputStream ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
BinaryInputStream rInStrm,
rtl_TextEncoding  eTextEnc 
)
explicit

◆ ~TextInputStream()

oox::TextInputStream::~TextInputStream ( )

Definition at line 112 of file textinputstream.cxx.

Member Function Documentation

◆ createFinalString()

OUString oox::TextInputStream::createFinalString ( const OUString &  rString)
private

Adds the pending character in front of the passed string, if existing.

Definition at line 190 of file textinputstream.cxx.

◆ createXTextInputStream()

Reference< XTextInputStream2 > oox::TextInputStream::createXTextInputStream ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
const css::uno::Reference< css::io::XInputStream > &  rxInStrm,
rtl_TextEncoding  eTextEnc 
)
static

Creates a UNO text input stream object from the passed UNO input stream.

Definition at line 170 of file textinputstream.cxx.

References Exception.

◆ init()

void oox::TextInputStream::init ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
const css::uno::Reference< css::io::XInputStream > &  rxInStrm,
rtl_TextEncoding  eTextEnc 
)
private

Definition at line 200 of file textinputstream.cxx.

◆ isEof()

bool oox::TextInputStream::isEof ( ) const

◆ readLine()

OUString oox::TextInputStream::readLine ( )

Reads a text line from the stream.

If the last line in the stream is not terminated with line-end character(s), the stream will immediately go into EOF state and return the text line. Otherwise, if the last character in the stream is a line-end character, the next call to this function will turn the stream into EOF state and return an empty string.

Definition at line 128 of file textinputstream.cxx.

References Exception.

Referenced by oox::dump::TextLineStreamObject::implDumpText(), oox::ole::VbaUserForm::importForm(), oox::ole::VbaModule::readSourceCode(), and oox::ole::VbaProject::readVbaModules().

◆ readToChar()

OUString oox::TextInputStream::readToChar ( sal_Unicode  cChar,
bool  bIncludeChar 
)

Reads a text portion from the stream until the specified character is found.

If the end of the stream is not terminated with the specified character, the stream will immediately go into EOF state and return the remaining text portion. Otherwise, if the last character in the stream is the specified character (and caller specifies to read and return it, see parameter bIncludeChar), the next call to this function will turn the stream into EOF state and return an empty string.

Parameters
cCharThe separator character to be read to.
bIncludeCharTrue = if found, the specified character will be read from stream and included in the returned string. False = the specified character will neither be read from the stream nor included in the returned string, but will be returned as first character in the next call of this function or readLine().

Definition at line 143 of file textinputstream.cxx.

References Exception.

Referenced by oox::dump::XmlStreamObject::implDumpText().

Member Data Documentation

◆ mcPendingChar

sal_Unicode oox::TextInputStream::mcPendingChar
private

Definition at line 113 of file textinputstream.hxx.

◆ mxTextStrm

css::uno::Reference< css::io::XTextInputStream2 > oox::TextInputStream::mxTextStrm
private

Definition at line 112 of file textinputstream.hxx.


The documentation for this class was generated from the following files: