Class RecordAttrs

Record attribute flags in PDB files.

In the DLP protocol, we use one byte to store record attribute flags and another byte to store the record category. However, in PDB files, we use a single byte is used to store both attribute flags and the record category.

This presents a problem: there are 5 record attributes (namely delete, dirty, busy, secret, and archive), leaving 3 bits unused, but we need 4 bits to store the record category. So the lowest 4 bits are overloaded, but the exactly how differs among existing open source implementations:

In pilot-link:

  • Upper 4 bits store the first 4 record attributes (delete, dirty, busy, secret)
  • Lower 4 bits store the record category; there's no archive bit

In ColdSync:

  • If the record is busy, bit 5 stores the archive flag and the lowest 3 bits are unused.
  • If the record is not busy, the lowest 4 bits store the category.

In the Palm::PDB Perl module:

  • If the record is deleted or busy, bit 5 stores the archive flag and the lowest 3 bits are unused.
  • If the record is neither deleted or busy, the lowest 4 bits store the category.

Here we've chosen to follow the Palm::PDB Perl module's implementation, as it is the most flexible.

References:

Hierarchy

  • {
        value: number;
        wrapperType: (new () => SerializableWrapper<number>);
        assignJSON(jsonValue: number | {
            [key: string]: number;
            [key: symbol]: number;
        }): void;
        deserialize(buffer: Buffer, opts?: DeserializeOptions): number;
        getSerializedLength(opts?: SerializeOptions): number;
        serialize(opts?: SerializeOptions): Buffer;
        toJSON(): any;
    }
    • RecordAttrs

Constructors

  • Returns RecordAttrs

Properties

busy: boolean = false

Record currently in use.

This bit may also indicate the record has been deleted -- see comments in https://github.com/dwery/coldsync/blob/master/include/pdb.h .

delete: boolean = false

Record has been deleted.

dirty: boolean = false

Record has been modified.

secret: boolean = false

"Secret" record - password protected.

value: number
wrapperType: (new () => SerializableWrapper<number>)

Accessors

Methods

  • Parameters

    • jsonValue: number | {
          [key: string]: number;
          [key: symbol]: number;
      }

    Returns void

  • Parameters

    • buffer: Buffer
    • Optionalopts: DeserializeOptions

    Returns number

  • Parameters

    • Optionalopts: SerializeOptions

    Returns number

  • Parameters

    • Optionalopts: SerializeOptions

    Returns Buffer

  • Returns any

  • Type Parameters

    • T_1 extends Serializable

    Parameters

    • this: (new () => T_1)
    • buffer: Buffer
    • Optionalopts: DeserializeOptions

    Returns T_1

  • Create a new instance of this wrapper class from a raw value.

    Type Parameters

    • SBitmaskT extends SBitmask

    Parameters

    Returns SBitmaskT

  • Create a new instance of this wrapper class from a raw value.

    Parameters

    • wrapperType: (new () => SerializableWrapper<number>)
        • new (): SerializableWrapper<number>
        • Returns SerializableWrapper<number>

    Returns any

  • Create a new instance with the provided initial properties.

    Type Parameters

    • T extends SBitmask

    Parameters

    • this: (new () => T)
        • new (): T
        • Returns T

    • Optionalprops: Partial<T>

    Returns T