A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/reader__zlib_8cpp_source.html below:

NCBI C++ ToolKit: src/util/compress/api/reader_zlib.cpp Source File

88  size_t Read

(

char

*

buffer

,

size_t

bufferLength);

91  size_t

x_Read(

char

*

buffer

,

size_t

bufferLength);

94

kMax_UncomprSize = 1024*1024,

95

kMax_ComprSize = 1024*1024

112

: m_Src(src), m_BufferPos(0), m_BufferEnd(0)

127  while

( buffer_length > 0 ) {

133

buffer_length -=

cnt

;

145  if

(

x_Read

(header, 8) != 8 ) {

147  "Too few header bytes"

);

149  size_t

compr_size = 0;

150  for

(

size_t i

= 0;

i

< 4; ++

i

) {

151

compr_size = (compr_size<<8) | (

unsigned char

)header[

i

];

153  size_t

uncompr_size = 0;

154  for

(

size_t i

= 4;

i

< 8; ++

i

) {

155

uncompr_size = (uncompr_size<<8) | (

unsigned char

)header[

i

];

160  "Compressed size is too large"

);

164  "Uncompressed size is too large"

);

168  "Compressed data is not complete"

);

177  "Decompression failed"

);

202

: m_Src(src), m_Type(eType_unknown)

223  "Too small buffer to determine compression type"

);

225  const char

* header =

buffer

;

226  size_t

got_already = 0;

232

buffer_length -=

cnt

;

233  if

(

cnt

== 0 || memcmp(header,

"ZIP"

, got_already) != 0 ) {

236  _TRACE

(

"CNlmZipBtRdr: non-ZIP: "

<< got_already);

270

: m_Reader(reader), m_Own(own), m_Header(header),

271

m_BufferPos(0), m_BufferEnd(0)

341

*bytes_read =

count

;

350  const char

* header =

buffer

;

351  size_t

header_read = 0;

361

header_read += cur_cnt;

362  if

( memcmp(header,

"ZIP"

, header_read) != 0 ) {

380  "No 'ZIP' header in NLMZIP stream"

);

395  static const size_t

kLengthsLength = 8;

396  static const size_t

kMax_UncomprSize = 1024*1024;

397  static const size_t

kMax_ComprSize = 1024*1024;

399  char

header[kLengthsLength];

408  size_t

compr_size = 0;

409  for

(

size_t i

= 0;

i

< 4; ++

i

) {

410

compr_size = (compr_size<<8) | (

unsigned char

)header[

i

];

412  size_t

uncompr_size = 0;

413  for

(

size_t i

= 4;

i

< 8; ++

i

) {

414

uncompr_size = (uncompr_size<<8) | (

unsigned char

)header[

i

];

417  if

( compr_size > kMax_ComprSize ) {

420  if

( uncompr_size > kMax_UncomprSize ) {

424

compr_size, &bytes) !=

eRW_Success

|| bytes != compr_size ) {

CZipCompression m_Decompressor

size_t Read(char *buffer, size_t bufferLength)

size_t x_Read(char *buffer, size_t bufferLength)

const CResultZBtSrcX & operator=(const CResultZBtSrcX &)

CDynamicCharArray m_Buffer

CResultZBtSrcX(CByteSourceReader *reader)

CResultZBtSrcX(const CResultZBtSrcX &)

CRef< CByteSourceReader > m_Src

CDynamicCharArray m_Compressed

A very basic data-read interface.

virtual ERW_Result PendingCount(size_t *count)

Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that a...

void x_StartDecompressor(void)

CRef< CByteSourceReader > m_Src

ERW_Result x_DecompressBuffer(void)

size_t x_ReadZipHeader(char *buffer)

virtual void SetFlags(TFlags flags)

virtual TFlags GetFlags(void) const

Get/set flags.

unique_ptr< CZipCompression > m_Decompressor

CDynamicCharArray m_Compressed

CNlmZipBtRdr(CByteSourceReader *src)

unique_ptr< CResultZBtSrcX > m_Decompressor

char * At(size_t pos) const

virtual size_t Read(char *buffer, size_t bufferLength)

Read up to bufferLength bytes into buffer return amount of bytes read (if zero - see EndOfData())

CDynamicCharArray m_Buffer

CNlmZipReader(IReader *reader, TOwnership own=fOwnNone, EHeader header=eHeaderCheck)

char * Alloc(size_t size)

ERW_Result x_Read(char *buffer, size_t count, size_t *bytes_read)

virtual ERW_Result Read(void *buf, size_t count, size_t *bytes_read=0)

Read as many as "count" bytes into a buffer pointed to by the "buf" argument.

virtual bool Pushback(const char *data, size_t size)

virtual bool DecompressBuffer(const void *src_buf, size_t src_len, void *dst_buf, size_t dst_size, size_t *dst_len)

Decompress data in the buffer.

@ fCheckFileHeader

Check (and skip) gzip file header on decompression stage.

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

void Read(CObjectIStream &in, TObjectPtr object, const CTypeRef &type)

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

virtual size_t Read(char *buffer, size_t bufferLength)=0

Read up to bufferLength bytes into buffer return amount of bytes read (if zero - see EndOfData())

virtual bool Pushback(const char *data, size_t size)

ERW_Result

Result codes for I/O operations.

virtual ERW_Result Read(void *buf, size_t count, size_t *bytes_read=0)=0

Read as many as "count" bytes into a buffer pointed to by the "buf" argument.

@ eRW_Eof

End of data, should be considered permanent.

@ eRW_Error

Unrecoverable error, no retry possible.

@ eRW_Success

Everything is okay, I/O completed.

const struct ncbi::grid::netcache::search::fields::SIZE size

Defines: CTimeFormat - storage class for time format.

NCBI_XUTIL_EXPORT

Parameter to control printing diagnostic message about conversion of static array data from a differe...


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4