#include <Iguana/Utilities/classlib/zip/ZipUtils.h>
Public Types | |
enum | { OPEN_READ = 1 } |
enum | { OPEN_WRITE = 2 } |
Static Protected Member Functions | |
static bool | extract (IOInput *input, void *buffer, IOSize size, IOSize n) |
static unsigned | get (const void *buffer, IOSize bytes) |
Read a bytes-long little-endian integer value from buffer. | |
static unsigned | getHex (const void *buffer, IOSize bytes) |
static unsigned | getOctal (const void *buffer, IOSize bytes) |
Read a bytes-long ASCII-octal integer value from buffer. | |
static void | put (void *buffer, IOSize bytes, unsigned value) |
Write value into buffer as bytes-long integer in little-endian byte order. | |
static void | putHex (void *buffer, IOSize bytes, unsigned value) |
static void | putOctal (void *buffer, IOSize bytes, unsigned value, bool null=true) |
Write value into buffer as bytes-long integer in ASCII octal. |
Definition at line 21 of file ZipUtils.h.
anonymous enum |
anonymous enum |
static bool lat::ZipUtils::extract | ( | IOInput * | input, | |
void * | buffer, | |||
IOSize | size, | |||
IOSize | n | |||
) | [static, protected] |
Read a bytes-long little-endian integer value from buffer.
Definition at line 50 of file ZipUtils.h.
References value.
00051 { 00052 const unsigned char *buf = static_cast<const unsigned char *> (buffer); 00053 unsigned value = 0; 00054 for (unsigned shift = 0; bytes; shift += 8, --bytes, ++buf) 00055 value += *buf << shift; 00056 00057 return value; 00058 }
Read a bytes-long ASCII-octal integer value from buffer.
Definition at line 62 of file ZipUtils.h.
References value.
00063 { 00064 const unsigned char *buf = static_cast<const unsigned char *> (buffer); 00065 unsigned value = 0; 00066 for ( ; bytes && *buf >= '0' && *buf <= '7'; --bytes, ++buf) 00067 value = (value << 3) + (*buf - '0'); 00068 00069 return value; 00070 }
Write value into buffer as bytes-long integer in little-endian byte order.
Definition at line 75 of file ZipUtils.h.
00076 { 00077 unsigned char *buf = static_cast<unsigned char *> (buffer); 00078 for ( ; bytes; value >>= 8, --bytes, ++buf) 00079 *buf = value & 0xff; 00080 }
static void lat::ZipUtils::putHex | ( | void * | buffer, | |
IOSize | bytes, | |||
unsigned | value | |||
) | [static, protected] |
void lat::ZipUtils::putOctal | ( | void * | buffer, | |
IOSize | bytes, | |||
unsigned | value, | |||
bool | null = true | |||
) | [inline, static, protected] |
Write value into buffer as bytes-long integer in ASCII octal.
Definition at line 85 of file ZipUtils.h.
00087 { 00088 unsigned char *buf = static_cast<unsigned char *> (buffer); 00089 if (null) 00090 buf [--bytes] = '\0'; 00091 00092 for (; bytes; value >>= 3) 00093 buf [--bytes] = (value & 7) + '0'; 00094 }