Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

BOOL PASNObject::DecodeASNUnsigned ( const PBYTEArray &  buffer,
PINDEX &  ptr,
PASNUnsigned &  value,
PASNObject::ASNType  theType = TimeTicks 
) [static, inherited]

Parameters:
buffer  buffer to decode from
ptr  ptr to data in buffer
value  returned value
theType  actual integer type

Definition at line 386 of file pasn.cxx.

References PASNObject::ASNTypeToType, and PASNObject::DecodeASNLength().

{
  if (buffer[ptr++] != ASNTypeToType[theType])
    return FALSE;

  WORD len;
  if (!DecodeASNLength(buffer, ptr, len))
    return FALSE;

  if (ptr + len > buffer.GetSize())
    return FALSE;

//  if (buffer[ptr] & 0x80)
//    value = -1; /* integer is negative */

  value = 0;
  while (len--)
    value = (value << 8) | buffer[ptr++];
  return TRUE;
}


Generated by  Doxygen 1.6.0   Back to index