25#ifndef SRC_XRDZIP_XRDZIPEOCD_HH_
26#define SRC_XRDZIP_XRDZIPEOCD_HH_
41 inline static const char*
Find(
const char *buffer, uint64_t size )
43 for( ssize_t offset = size -
eocdBaseSize; offset >= 0; --offset )
46 if( signature ==
eocdSign )
return buffer + offset;
54 EOCD(
const char *buffer, uint32_t maxSize = 0 )
74 EOCD( uint64_t cdoff, uint32_t cdcnt, uint32_t cdsize ):
118 std::copy(
comment.begin(),
comment.end(), std::back_inserter( buffer ) );
126 std::stringstream ss;
127 ss <<
"{nbDisk=" <<
nbDisk;
131 ss <<
";cdSize" <<
cdSize;
134 ss <<
";comment=" <<
comment <<
'}';
static INT to(const char *buffer)
std::vector< char > buffer_t
static void copy_bytes(const INT value, buffer_t &buffer)
static const uint16_t eocdBaseSize
static const uint16_t maxCommentLength
std::string ToString()
Convert the EOCD into a string for logging purposes.
static const char * Find(const char *buffer, uint64_t size)
EOCD(const char *buffer, uint32_t maxSize=0)
Constructor from buffer.
EOCD(uint64_t cdoff, uint32_t cdcnt, uint32_t cdsize)
Constructor from last LFH + CDFH.
static const uint32_t eocdSign
void Serialize(buffer_t &buffer)
Serialize the object into a buffer.