HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_IStreamBuf Class Referenceabstract

#include <UT_IStreamBuf.h>

Public Types

enum  { UT_SEEK_BEG =0, UT_SEEK_CUR =1, UT_SEEK_END =2 }
 

Public Member Functions

 UT_IStreamBuf (bool bufferable=true)
 
void bumpRef ()
 
void decRef ()
 
virtual void setIndex (const UT_CompressedBlockIndexPtr &index)
 
bool isEof () const
 
virtual exint read (char *buffer, exint asize=1)=0
 
virtual int streamPeek ()=0
 
virtual bool closeFile ()
 
virtual bool isRandomAccessFile (UT_WorkBuffer &filename) const
 
virtual int getFileSystemType () const
 
virtual int getFileDescriptor () const
 
bool getError () const
 
const char * getErrorStr () const
 
void stealLoadBufferData (const char *&bufstart, const char *&bufend, exint maxlen)
 
exint bread (char *buffer, exint size)
 
exint tellg () const
 
bool seekg (exint pos, int seekdir)
 
void clearLoadBuffer ()
 
bool getLine (UT_WorkBuffer &buffer, int end='\n')
 
bool skipLine (int end='\n')
 
bool getJSONWord (UT_WorkBuffer &buffer, bool &real)
 
bool getWord (UT_WorkBuffer &buffer)
 
bool getString (UT_WorkBuffer &buffer)
 
bool getNumber (UT_WorkBuffer &buffer, bool &real)
 
bool skipWhitespace ()
 
bool skipWhitespace (int64 *line_count, int64 *line_start_pos)
 
bool getAll (UT_WorkBuffer &buffer)
 
bool getAllAscii (UT_WorkBuffer &buffer)
 
SYS_FORCE_INLINE bool checkToken (const char *match)
 
SYS_FORCE_INLINE int getc ()
 
SYS_FORCE_INLINE int peekc ()
 
SYS_FORCE_INLINE exint unwind (exint len)
 
virtual int64 getMemoryUsage (bool inclusive) const
 
bool isBufferable () const
 

Static Public Member Functions

static UT_IStreamBufnullBuf ()
 
static UT_IStreamBuffileBuf (const UT_StringHolder &filename, const UT_Options *options, bool bufferable)
 
static UT_IStreamBuffileBuf (FILE *fp, bool bufferable)
 
static UT_IStreamBufistreamBuf (std::istream &is, bool bufferable)
 
static UT_IStreamBufmemoryBuf (const char *src, size_t len)
 
static UT_IStreamBufrangeBuf (UT_IStreamBuf *src, int64 start, int64 end)
 
static UT_IStreamBufzlibBuf (UT_IStreamBuf *src, bool bufferable=true)
 
static UT_IStreamBufgzipBuf (UT_IStreamBuf *src, bool bufferable=true)
 
static UT_IStreamBufbloscBuf (UT_IStreamBuf *src, bool bufferable=true)
 
static UT_IStreamBufscBuf (UT_IStream *src, bool bufferable=true)
 
static UT_IStreamBufblowfishBuf (UT_IStreamBuf *src, const unsigned char *key, exint key_length, bool bufferable=true)
 
static exint blowfishPlainTextLength (UT_IStreamBuf *src)
 
static void setStdinCompatible (bool state)
 

Protected Member Functions

virtual ~UT_IStreamBuf ()
 
void setError (const char *msg=0)
 
bool getAlNumWord (UT_WorkBuffer &buffer, const char *prefix="")
 
virtual void loadBuffer (exint &bufstartpos, const char *&bufstart, const char *&bufend, bool keepeofif0)=0
 
virtual exint tellPos () const =0
 
virtual bool seekPos (exint pos, int dir)=0
 
virtual bool endOfFileSet () const =0
 
bool loadBuffer (bool keepeofif0=false)
 
void appendDecodedEscapeSequence (UT_WorkBuffer &buffer)
 

Detailed Description

Definition at line 36 of file UT_IStreamBuf.h.

Member Enumeration Documentation

anonymous enum
Enumerator
UT_SEEK_BEG 
UT_SEEK_CUR 
UT_SEEK_END 

Definition at line 40 of file UT_IStreamBuf.h.

Constructor & Destructor Documentation

UT_IStreamBuf::UT_IStreamBuf ( bool  bufferable = true)
virtual UT_IStreamBuf::~UT_IStreamBuf ( )
protectedvirtual

Member Function Documentation

void UT_IStreamBuf::appendDecodedEscapeSequence ( UT_WorkBuffer buffer)
protected
static UT_IStreamBuf* UT_IStreamBuf::bloscBuf ( UT_IStreamBuf src,
bool  bufferable = true 
)
static
static UT_IStreamBuf* UT_IStreamBuf::blowfishBuf ( UT_IStreamBuf src,
const unsigned char *  key,
exint  key_length,
bool  bufferable = true 
)
static
static exint UT_IStreamBuf::blowfishPlainTextLength ( UT_IStreamBuf src)
static
exint UT_IStreamBuf::bread ( char *  buffer,
exint  size 
)
inline

Definition at line 124 of file UT_IStreamBuf.h.

void UT_IStreamBuf::bumpRef ( )
inline

Definition at line 73 of file UT_IStreamBuf.h.

SYS_FORCE_INLINE bool UT_IStreamBuf::checkToken ( const char *  match)
inline

Definition at line 234 of file UT_IStreamBuf.h.

void UT_IStreamBuf::clearLoadBuffer ( )
virtual bool UT_IStreamBuf::closeFile ( )
virtual
void UT_IStreamBuf::decRef ( )
inline

Definition at line 74 of file UT_IStreamBuf.h.

virtual bool UT_IStreamBuf::endOfFileSet ( ) const
protectedpure virtual
static UT_IStreamBuf* UT_IStreamBuf::fileBuf ( const UT_StringHolder filename,
const UT_Options options,
bool  bufferable 
)
static
static UT_IStreamBuf* UT_IStreamBuf::fileBuf ( FILE *  fp,
bool  bufferable 
)
static
bool UT_IStreamBuf::getAll ( UT_WorkBuffer buffer)
bool UT_IStreamBuf::getAllAscii ( UT_WorkBuffer buffer)
bool UT_IStreamBuf::getAlNumWord ( UT_WorkBuffer buffer,
const char *  prefix = "" 
)
protected
SYS_FORCE_INLINE int UT_IStreamBuf::getc ( )
inline

getc and peek return the character read as an unsigned char cast to an int, or -1 (EOF) on failure. In other words, characters with the high bit set will return a number from 128 to 255, not a negative number.

Definition at line 258 of file UT_IStreamBuf.h.

bool UT_IStreamBuf::getError ( ) const
inline

Definition at line 118 of file UT_IStreamBuf.h.

const char* UT_IStreamBuf::getErrorStr ( ) const
virtual int UT_IStreamBuf::getFileDescriptor ( ) const
virtual
virtual int UT_IStreamBuf::getFileSystemType ( ) const
virtual
bool UT_IStreamBuf::getJSONWord ( UT_WorkBuffer buffer,
bool &  real 
)
bool UT_IStreamBuf::getLine ( UT_WorkBuffer buffer,
int  end = '\n' 
)
virtual int64 UT_IStreamBuf::getMemoryUsage ( bool  inclusive) const
virtual
bool UT_IStreamBuf::getNumber ( UT_WorkBuffer buffer,
bool &  real 
)
bool UT_IStreamBuf::getString ( UT_WorkBuffer buffer)
bool UT_IStreamBuf::getWord ( UT_WorkBuffer buffer)
static UT_IStreamBuf* UT_IStreamBuf::gzipBuf ( UT_IStreamBuf src,
bool  bufferable = true 
)
static
bool UT_IStreamBuf::isBufferable ( ) const
inline

Definition at line 290 of file UT_IStreamBuf.h.

bool UT_IStreamBuf::isEof ( ) const
inline

Definition at line 87 of file UT_IStreamBuf.h.

virtual bool UT_IStreamBuf::isRandomAccessFile ( UT_WorkBuffer filename) const
virtual
static UT_IStreamBuf* UT_IStreamBuf::istreamBuf ( std::istream &  is,
bool  bufferable 
)
static
virtual void UT_IStreamBuf::loadBuffer ( exint bufstartpos,
const char *&  bufstart,
const char *&  bufend,
bool  keepeofif0 
)
protectedpure virtual
bool UT_IStreamBuf::loadBuffer ( bool  keepeofif0 = false)
protected
static UT_IStreamBuf* UT_IStreamBuf::memoryBuf ( const char *  src,
size_t  len 
)
static
static UT_IStreamBuf* UT_IStreamBuf::nullBuf ( )
static
SYS_FORCE_INLINE int UT_IStreamBuf::peekc ( )
inline

Definition at line 272 of file UT_IStreamBuf.h.

static UT_IStreamBuf* UT_IStreamBuf::rangeBuf ( UT_IStreamBuf src,
int64  start,
int64  end 
)
static
virtual exint UT_IStreamBuf::read ( char *  buffer,
exint  asize = 1 
)
pure virtual
static UT_IStreamBuf* UT_IStreamBuf::scBuf ( UT_IStream src,
bool  bufferable = true 
)
static
bool UT_IStreamBuf::seekg ( exint  pos,
int  seekdir 
)
inline

Definition at line 185 of file UT_IStreamBuf.h.

virtual bool UT_IStreamBuf::seekPos ( exint  pos,
int  dir 
)
protectedpure virtual
void UT_IStreamBuf::setError ( const char *  msg = 0)
protected
virtual void UT_IStreamBuf::setIndex ( const UT_CompressedBlockIndexPtr index)
inlinevirtual

Set the index for the stream buffer (does nothing if stream buffer does not support index)

Definition at line 83 of file UT_IStreamBuf.h.

static void UT_IStreamBuf::setStdinCompatible ( bool  state)
static
bool UT_IStreamBuf::skipLine ( int  end = '\n')
inline

Definition at line 360 of file UT_IStreamBuf.h.

SYS_FORCE_INLINE bool UT_IStreamBuf::skipWhitespace ( )

Definition at line 336 of file UT_IStreamBuf.h.

bool UT_IStreamBuf::skipWhitespace ( int64 line_count,
int64 line_start_pos 
)
void UT_IStreamBuf::stealLoadBufferData ( const char *&  bufstart,
const char *&  bufend,
exint  maxlen 
)
virtual int UT_IStreamBuf::streamPeek ( )
pure virtual
exint UT_IStreamBuf::tellg ( ) const
inline

Definition at line 177 of file UT_IStreamBuf.h.

virtual exint UT_IStreamBuf::tellPos ( ) const
protectedpure virtual
SYS_FORCE_INLINE exint UT_IStreamBuf::unwind ( exint  len)
inline

Definition at line 281 of file UT_IStreamBuf.h.

static UT_IStreamBuf* UT_IStreamBuf::zlibBuf ( UT_IStreamBuf src,
bool  bufferable = true 
)
static

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