NCBI C++ ToolKit
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
CIStreamBuffer Class Reference

Search Toolkit Book for CIStreamBuffer

#include <util/strbuffer.hpp>

+ Collaboration diagram for CIStreamBuffer:

Public Member Functions

 CIStreamBuffer (void)
 CIStreamBuffer (const char *buffer, size_t size)
 ~CIStreamBuffer (void)
bool fail (void) const
void ResetFail (void)
const char * GetError (void) const
void Open (CByteSourceReader &reader)
void Open (const char *buffer, size_t size)
void Close (void)
void SetCanceledCallback (const ICanceled *callback)
char PeekChar (size_t offset=0)
char PeekCharNoEOF (size_t offset=0)
bool HasMore (void)
char GetChar (void)
void UngetChar (char c)
void SkipChars (size_t count)
void SkipChar (void)
bool SkipExpectedChar (char c, size_t offset=0)
bool SkipExpectedChars (char c1, char c2, size_t offset=0)
void GetChars (char *buffer, size_t count)
void GetChars (string &str, size_t count)
void GetChars (size_t count)
void SkipEndOfLine (char lastChar)
char SkipSpaces (void)
void FindChar (char c)
size_t PeekFindChar (char c, size_t limit)
const char * GetCurrentPos (void) const
bool TrySetCurrentPos (const char *pos)
size_t GetLine (void) const
CNcbiStreampos GetStreamOffset (void) const
void SetStreamOffset (CNcbiStreampos pos)
CNcbiStreampos GetStreamPos (void) const
Int8 GetStreamPosAsInt8 (void) const
void SetStreamPos (CNcbiStreampos pos)
size_t ReadLine (char *buff, size_t size)
char SkipWs (void)
Int4 GetInt4 (void)
Uint4 GetUint4 (void)
Int8 GetInt8 (void)
Uint8 GetUint8 (void)
void StartSubSource (void)
CRef< CByteSourceEndSubSource (void)
CRef< CSubSourceCollector > & GetSubSourceCollector (void)
bool EndOfData (void) const
size_t SetBufferLock (size_t size)
void ResetBufferLock (size_t pos)

Protected Member Functions

const char * FillBuffer (const char *pos, bool noEOF=false)
char FillBufferNoEOF (const char *pos)
bool TryToFillBuffer (void)
void BadNumber (void)
void NumberOverflow (void)

Private Attributes

CRef< CByteSourceReaderm_Input
const char * m_Error
Int8 m_BufferPos
size_t m_BufferSize
char * m_Buffer
const char * m_CurrentPos
const char * m_DataEndPos
size_t m_Line
const char * m_CollectPos
CRef< CSubSourceCollectorm_Collector
CConstIRef< ICanceledm_CanceledCallback
size_t m_BufferLockSize

Detailed Description

Definition at line 60 of file strbuffer.hpp.

Constructor & Destructor Documentation

CIStreamBuffer::CIStreamBuffer ( void  )

Definition at line 53 of file strbuffer.cpp.

CIStreamBuffer::CIStreamBuffer ( const char *  buffer,
size_t  size 

Definition at line 65 of file strbuffer.cpp.

CIStreamBuffer::~CIStreamBuffer ( void  )

Definition at line 76 of file strbuffer.cpp.

References Close(), m_Buffer, m_BufferSize, and NCBI_CATCH_X.

Member Function Documentation

void CIStreamBuffer::BadNumber ( void  )

Definition at line 518 of file strbuffer.cpp.

References GetLine(), m_Error, and NCBI_THROW_FMT.

Referenced by GetInt4(), GetInt8(), GetUint4(), and GetUint8().

void CIStreamBuffer::Close ( void  )
bool CIStreamBuffer::EndOfData ( void  ) const

Definition at line 166 of file strbuffer.hpp.

References CByteSourceReader::EndOfData(), m_CurrentPos, m_DataEndPos, and m_Input.

Referenced by CObjectIStream::EndOfData().

CRef< CByteSource > CIStreamBuffer::EndSubSource ( void  )
bool CIStreamBuffer::fail ( void  ) const
const char * CIStreamBuffer::FillBuffer ( const char *  pos,
bool  noEOF = false 

Definition at line 295 of file strbuffer.cpp.

References _ASSERT, BiggerBufferSize(), CT_OFF_TYPE, eRead, memmove, min(), and NCBI_THROW.

Referenced by FillBufferNoEOF(), SkipSpaces(), and TryToFillBuffer().

char CIStreamBuffer::FillBufferNoEOF ( const char *  pos)

Definition at line 410 of file strbuffer.cpp.

References FillBuffer(), and m_DataEndPos.

void CIStreamBuffer::FindChar ( char  c)
char CIStreamBuffer::GetChar ( void  )
void CIStreamBuffer::GetChars ( char *  buffer,
size_t  count 

Definition at line 424 of file strbuffer.cpp.

References buffer.

Referenced by CObjectIStreamAsnBinary::ReadBytes(), and CObjectIStreamAsnBinary::SkipBytes().

void CIStreamBuffer::GetChars ( string str,
size_t  count 

Definition at line 447 of file strbuffer.cpp.

void CIStreamBuffer::GetChars ( size_t  count)
const char* CIStreamBuffer::GetCurrentPos ( void  ) const
const char* CIStreamBuffer::GetError ( void  ) const
Int4 CIStreamBuffer::GetInt4 ( void  )
Int8 CIStreamBuffer::GetInt8 ( void  )
size_t CIStreamBuffer::GetLine ( void  ) const
CNcbiStreampos CIStreamBuffer::GetStreamOffset ( void  ) const
CNcbiStreampos CIStreamBuffer::GetStreamPos ( void  ) const
Int8 CIStreamBuffer::GetStreamPosAsInt8 ( void  ) const
CRef<CSubSourceCollector>& CIStreamBuffer::GetSubSourceCollector ( void  )

Definition at line 162 of file strbuffer.hpp.

References m_Collector.

Referenced by CObjectIStreamXml::StartDelayBuffer().

Uint4 CIStreamBuffer::GetUint4 ( void  )
Uint8 CIStreamBuffer::GetUint8 ( void  )
bool CIStreamBuffer::HasMore ( void  )
void CIStreamBuffer::NumberOverflow ( void  )

Definition at line 526 of file strbuffer.cpp.

References GetLine(), m_Error, and NCBI_THROW_FMT.

Referenced by GetInt4(), GetInt8(), GetUint4(), and GetUint8().

void CIStreamBuffer::Open ( CByteSourceReader reader)
void CIStreamBuffer::Open ( const char *  buffer,
size_t  size 

Definition at line 98 of file strbuffer.cpp.

References buffer, Close(), m_Buffer, m_BufferSize, m_CurrentPos, m_DataEndPos, m_Error, and size.

char CIStreamBuffer::PeekChar ( size_t  offset = 0)
char CIStreamBuffer::PeekCharNoEOF ( size_t  offset = 0)
size_t CIStreamBuffer::PeekFindChar ( char  c,
size_t  limit 

Definition at line 270 of file strbuffer.cpp.

References _ASSERT, and min().

Referenced by CObjectIStreamXml::ReadEscapedChar().

size_t CIStreamBuffer::ReadLine ( char *  buff,
size_t  size 

Definition at line 489 of file strbuffer.cpp.

References size, and SkipChar().

void CIStreamBuffer::ResetBufferLock ( size_t  pos)
void CIStreamBuffer::ResetFail ( void  )
size_t CIStreamBuffer::SetBufferLock ( size_t  size)
void CIStreamBuffer::SetCanceledCallback ( const ICanceled callback)

Definition at line 127 of file strbuffer.cpp.

References m_CanceledCallback.

Referenced by CObjectIStream::SetCanceledCallback().

void CIStreamBuffer::SetStreamOffset ( CNcbiStreampos  pos)
Use SetStreamPos() instead
See also

Definition at line 534 of file strbuffer.cpp.

References SetStreamPos().

void CIStreamBuffer::SetStreamPos ( CNcbiStreampos  pos)
void CIStreamBuffer::SkipChar ( void  )
void CIStreamBuffer::SkipChars ( size_t  count)
void CIStreamBuffer::SkipEndOfLine ( char  lastChar)
bool CIStreamBuffer::SkipExpectedChar ( char  c,
size_t  offset = 0 
bool CIStreamBuffer::SkipExpectedChars ( char  c1,
char  c2,
size_t  offset = 0 
char CIStreamBuffer::SkipSpaces ( void  )
char CIStreamBuffer::SkipWs ( void  )

Definition at line 558 of file strbuffer.cpp.

References GetChar(), and isspace().

Referenced by GetInt4(), GetInt8(), GetUint4(), and GetUint8().

void CIStreamBuffer::StartSubSource ( void  )
bool CIStreamBuffer::TrySetCurrentPos ( const char *  pos)

Definition at line 286 of file strbuffer.cpp.

References m_Buffer, m_BufferPos, m_CurrentPos, and m_DataEndPos.

bool CIStreamBuffer::TryToFillBuffer ( void  )

Definition at line 419 of file strbuffer.cpp.

References FillBuffer(), m_CurrentPos, and m_DataEndPos.

void CIStreamBuffer::UngetChar ( char  c)

Member Data Documentation

char* CIStreamBuffer::m_Buffer
size_t CIStreamBuffer::m_BufferLockSize

Definition at line 212 of file strbuffer.hpp.

Referenced by ResetBufferLock(), and SetBufferLock().

Int8 CIStreamBuffer::m_BufferPos

Definition at line 201 of file strbuffer.hpp.

Referenced by Close(), SetStreamPos(), and TrySetCurrentPos().

size_t CIStreamBuffer::m_BufferSize

Definition at line 202 of file strbuffer.hpp.

Referenced by Open(), and ~CIStreamBuffer().

CConstIRef<ICanceled> CIStreamBuffer::m_CanceledCallback

Definition at line 211 of file strbuffer.hpp.

Referenced by SetCanceledCallback().

CRef<CSubSourceCollector> CIStreamBuffer::m_Collector

Definition at line 209 of file strbuffer.hpp.

Referenced by EndSubSource(), GetSubSourceCollector(), and StartSubSource().

const char* CIStreamBuffer::m_CollectPos

Definition at line 208 of file strbuffer.hpp.

Referenced by EndSubSource(), and StartSubSource().

const char* CIStreamBuffer::m_CurrentPos
const char* CIStreamBuffer::m_DataEndPos
const char* CIStreamBuffer::m_Error

Definition at line 199 of file strbuffer.hpp.

Referenced by BadNumber(), Close(), NumberOverflow(), and Open().

CRef<CByteSourceReader> CIStreamBuffer::m_Input

Definition at line 197 of file strbuffer.hpp.

Referenced by Close(), EndOfData(), Open(), SetStreamPos(), and StartSubSource().

size_t CIStreamBuffer::m_Line

Definition at line 206 of file strbuffer.hpp.

Referenced by Close(), and SetStreamPos().

The documentation for this class was generated from the following files:
Modified on Tue Oct 13 11:08:35 2015 by rev. 426318