Previous: WordKey ASCII FORMAT, Up: WordKey [Contents][Index]
Constructor. Build an empty key. The ncontext argument must be a pointer to a valid WordContext object.
Constructor. Initialize from an ASCII description of a key.
See
ASCII FORMAT
section.
The
ncontext
argument must be a pointer to a valid
WordContext object.
Reset to empty key.
Convenience functions to access the total number of fields
in a key (see
WordKeyInfo(3)
).
Convenience functions to access the
maximum possible value for field at
position.
in a key (see
WordKeyInfo(3)
).
Return a pointer to the WordContext object used to create this instance.
Return a pointer to the WordContext object used to create this instance as a const.
Return value of numerical field at position as const.
Return value of numerical field at position.
Return value of numerical field at position as const.
Return value of numerical field at position.
Set value of numerical field at position to val.
Returns true if field at
position
is
defined
, false
otherwise.
Value in field
position
becomes
defined.
A bit
is set in the bit field describing the defined/undefined state
of the value and the actual value of the field is not modified.
Value in field
position
becomes
undefined.
A bit
is set in the bit field describing the defined/undefined state
of the value and the actual value of the field is not modified.
Set the whole structure from ASCII string in
bufferin.
See
ASCII FORMAT
section.
Return OK if successfull, NOTOK otherwise.
Convert the whole structure to an ASCII string description
in
bufferout.
See
ASCII FORMAT
section.
Return OK if successfull, NOTOK otherwise.
Convert the whole structure to an ASCII string description
and return it.
See
ASCII FORMAT
section.
Set structure from disk storage format as found in string buffer or length length. Return OK if successfull, NOTOK otherwise.
Set structure from disk storage format as found in data string. Return OK if successfull, NOTOK otherwise.
Convert object into disk storage format as found in and place the result in data string. Return OK if successfull, NOTOK otherwise.
Copy each
defined
field from other into the object, if
the corresponding field of the object is not defined.
Return OK if successfull, NOTOK otherwise.
Undefine all fields found after the first undefined field. The resulting key has a set of defined fields followed by undefined fields. Returns NOTOK if the word is not defined because the resulting key would be empty and this is considered an error. Returns OK on success.
Implement ++ on a key.
It behaves like arithmetic but follows these rules:
. Increment starts at field <position> . If a field value overflows, increment field position - 1 . Undefined fields are ignored and their value untouched . When a field is incremented all fields to the left are set to 0
If position is not specified it is equivalent to NFields() - 1. It returns OK if successfull, NOTOK if position out of range or WORD_FOLLOWING_ATEND if the maximum possible value was reached.
Return true if all the fields are
defined
, false otherwise.
Return true if no fields are
defined
, false otherwise.
Return true if the object and other are equal. Only fields defined in both keys are compared.
Return true if the object and other are equal. All fields are compared. If a field is defined in object and not defined in the object, the key are not considered equal.
Compare object and other as in strcmp. Undefined fields are ignored. Returns a positive number if object is greater than other , zero if they are equal, a negative number if object is lower than other.
Return true if the object and
other
are equal.
The packed string are compared. An
undefined
numerical field
will be 0 and therefore undistinguishable from a
defined
field
whose value is 0.
Return true if adding increment in field at position makes it overflow or underflow, false if it fits.
Return true if adding positive increment to field at position makes it overflow, false if it fits.
Return true if subtracting positive increment to field at position makes it underflow, false if it fits.
Return OK if the key may be used as a prefix for search. In other words return OK if the fields set in the key are all contiguous, starting from the first field. Otherwise returns NOTOK
Compare
a
and
b
in the Berkeley DB fashion.
a
and
b
are packed keys. The semantics of the
returned int is as of strcmp and is driven by the key description
found in
WordKeyInfo.
Returns a positive number if
a
is
greater than
b
, zero if they are equal, a negative number
if
a
is lower than
b.
Compare
a
and
b
in the Berkeley DB fashion.
a
and
b
are packed keys. The semantics of the
returned int is as of strcmp and is driven by the key description
found in
WordKeyInfo.
Returns a positive number if
a
is
greater than
b
, zero if they are equal, a negative number
if
a
is lower than
b.
Compare object defined fields with other key defined fields only, ignore fields that are not defined in object or other. Return 1 if different 0 if equal. If different, position is set to the field number that differ, lower is set to 1 if Get( position ) is lower than other.Get( position ) otherwise lower is set to 0.
Print object in ASCII form on
f
(uses
Get
method).
See
ASCII FORMAT
section.
Print object in ASCII form on
stdout
(uses
Get
method).
See
ASCII FORMAT
section.
Previous: WordKey ASCII FORMAT, Up: WordKey [Contents][Index]