InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CTxtImpFileReader Class Referenceabstract

#include <CTxtImpFileReader.h>

Inheritance diagram for CTxtImpFileReader:
CPMUnknown< ITxtImpFileReader >ITxtImpFileReaderIPMUnknownASCIIFileReaderJISFileReaderShiftJISFileReaderUNICODEFileReader

Public Member Functions

 CTxtImpFileReader (IPMUnknown *boss)
 
virtual ~CTxtImpFileReader (void)
 
virtual void SetStream (IPMStream *stream)
 
virtual int32 GetFileSizeInBytes (void)
 
virtual UTF16TextChar GetNextTextChar (void)=0
 
- Public Member Functions inherited from CPMUnknown< ITxtImpFileReader >
IPMUnknownQueryInterface (PMIID interfaceID) const
 
void AddRef () const
 
void Release () const
 
void PreDirty (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
void PreDirtyNoMessage (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
 CPMUnknown (const CPMUnknown &)=delete
 
CPMUnknownoperator= (const CPMUnknown &)=delete
 

Protected Attributes

IPMStreamfStream
 
UTF16TextChar * fTCBuf
 
uchar * fCBuf
 
int32 fLen
 
int32 fCurrMarker
 
int32 fEndOfReadMarker
 
- Protected Attributes inherited from CPMUnknown< ITxtImpFileReader >
HelperInterface fHelperInterface
 

Additional Inherited Members

- Public Types inherited from ITxtImpFileReader
enum  Encoding {
  kTxtImpEncodingInvalid = -1, kTxtImpEncodingASCII, kTxtImpEncodingRESERVED, kTxtImpEncodingShiftJIS,
  kTxtImpEncodingJIS, kTxtImpEncodingEUCJP, kTxtImpEncodingUTF16BE, kTxtImpEncodingUTF16LE
}
 
enum  { kDefaultIID = IID_ITXTIMPFILEREADER }
 
- Protected Member Functions inherited from CPMUnknown< ITxtImpFileReader >
 CPMUnknown (IPMUnknown *boss)
 

Detailed Description

CTxtImpFileReader Provides a partial implementation for a file reader. The only method that is missing is the GetNextTextChar, in which subclasses of CTxtImpFileReader will perform the actual conversions of various encodings to UNICODE, and store it in a local UTF16TextChar buffer.

Constructor & Destructor Documentation

CTxtImpFileReader::CTxtImpFileReader (IPMUnknownboss)

Constructor

Parameters
bossinterface ptr from boss object on which this interface is aggregated.
CTxtImpFileReader::~CTxtImpFileReader (void )
virtual

Destructor

Member Function Documentation

int32 CTxtImpFileReader::GetFileSizeInBytes (void )
virtual

Returns the stream (file) size in bytes.

Implements ITxtImpFileReader.

virtual UTF16TextChar CTxtImpFileReader::GetNextTextChar (void )
pure virtual

(pure abstract method) Gets next text char from internal text char buffer. If the buffer has been read until the end or is empty, it reads a chunk out the stream, converts the text to UNICODE, and stores it in the buffer. Subclasses must provide the implementation.

Implements ITxtImpFileReader.

Implemented in ShiftJISFileReader, JISFileReader, ASCIIFileReader, and UNICODEFileReader.

void CTxtImpFileReader::SetStream (IPMStreamstream)
virtual

Sets the stream to read.

Parameters
streamIPMStream to read.

Implements ITxtImpFileReader.

Member Data Documentation

uchar* CTxtImpFileReader::fCBuf
protected

Stores bytes directly read from stream. This is the data before UNICODE conversion

int32 CTxtImpFileReader::fCurrMarker
protected

Stores the current marker position within fTCBuf. Used in GetNextTextChar.

int32 CTxtImpFileReader::fEndOfReadMarker
protected

Stores the position of the last character within fTCBuf. Used in GetNextTextChar.

int32 CTxtImpFileReader::fLen
protected

Stores length of stream.

IPMStream* CTxtImpFileReader::fStream
protected

Stores IPMStream of currently opened stream (indicated by fFilename)

UTF16TextChar* CTxtImpFileReader::fTCBuf
protected

Stores a "chunk" of file text in a UNICODE buffer