CosObject Class

Definition

One COS object: a value exactly as a PDF file stores it. The hierarchy is closed; every object is one of CosBoolean, CosInteger, CosReal, CosString, CosName, CosArray, CosDictionary, CosStream, CosNull or CosReference.

public abstract class CosObject

Remarks

ISO 32000-2 §7.3.

Mutability. Booleans, numbers, strings, names, null and references are immutable values. Arrays, dictionaries and streams are mutable containers.

Dirty tracking. IsDirty is false for every object a parser produces and for every newly constructed object, and becomes true once the object, or any direct object it contains, is changed through the public API. Immutable objects are never dirty; replacing one inside a container makes the container dirty. Indirect references are not followed: a change to the object a CosReference points to does not make the referring container dirty.

Equality. Equals(Object?) is value equality for the immutable objects and reference identity for the mutable containers, so a container is safe as a hash key while it changes. DeepEquals(CosObject?, CosObject?) compares structure, and is the equality a serialize-then-parse round trip preserves.

Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.

Properties (1)

Methods (5)