PReplyBuf

Manages a buffer returned by a PageMaker query. This is normally used to copy values out of a handle or out of a block of memory on the stack to fields in a high level query object.

Not all query classes need a PReplyBuf object; its primary role is handling queries that return a variable amount of data. Queries that return a fixed amount of data generally do not use PReplyBuf objects.


Constructor

PReplyBuf(const char * ch);
A PReplyBuf object is created with a pointer to the memory it is responsible for. Note that this class does not know how much data it is responsible for, nor is it responsible for allocating or deleting the memory that it refers to.

Member functions

This class overloads various operator>>() functions to extract fields from the reply buffer.

PReplyBuf& operator>> (const char ** aStringRef);

Just set const char * and scan over the string. The C string is not copied.
PReplyBuf& operator>> (const char * aString);
Copy the C string. The receiving buffer must be large enough to fit the whole string.
PReplyBuf& operator>> (unsigned const char * aString);
Copy the Pascal string.
PReplyBuf& operator>> (short& aShort);
Scan two bytes and put short value into aShort.
PReplyBuf& operator>> (unsigned short& aShort);
Scan two bytes and put short value into aShort.
PReplyBuf& operator>> (long& aLong);
Scan four bytes and put short value into aLong.
PReplyBuf& operator>> (unsigned long& aLong);
Scan four bytes and put short value into aLong.
operator const char *();
Return a pointer to the current value (curCh). This may be different than the original value passed to the constructor.
void Reset();
Reset curCh to point to the start of the buffer (bufStart).

Member fields

All fields are private to the class.

const char * bufStart;

Always points to the beginning address that was a parameter to the constructor.
const char * curCh;
Points to the current position being scanned. This field is updated by various operator>>() functions.


See also

The PRequestBuf low level class


Copyright © 1996, Adobe Systems Incorporated. All rights reserved.

Comments or suggestions? Contact Adobe Developer Support