Module type Signatures.NodeRepresentation

Representation of Nodes

include ObjectCommon
type t

Identifier

val id : t -> Common.Id.t

Object identifier.

val compare : t -> t -> int

Comparison function.

Tags manipuation

val tags : t -> Common.Tags.t

Get all the tags of an object.

val compare_tags : t -> t -> int
val has_key : Common.Tags.key -> t -> bool

Check if a key is present.

val get_key : Common.Tags.key -> t -> Common.Tags.value option

Value associated to a key

val has_tag_with : Common.Tags.key -> value:Common.Tags.value -> t -> bool

Check if a tag has the provided value.

val has_tag_contains : Common.Tags.key -> values:Common.Tags.value list -> t -> bool

Check if a tag has one of the provided values.

Hints

If stored or inferred, these functions return the hints provided to the create function (see type object_create above).

val version : t -> int option

Object version.

val changeset : t -> Common.Id.changeset option

The last changeset that changed the object.

val visible : t -> bool option

Whether it should be visible when editing.

val uid : t -> Common.Id.user option

The identifier of the last user who edited this object.

val user : t -> string option

The UTF-8-encoded name of this last user.

val timestamp : t -> CalendarLib.Calendar.t option

The last time when this object was modified.

val area : t -> bool option
val has_changed : t -> bool option

Conversion from and to objects

type object_type
val to_object : t -> object_type

Convert a node to an object.

val of_object : object_type -> t option

Synonym of Object.to_node.

val position : t -> Common.Position.t

Get the position of a node.

Create a node with its position and optional identifier and tags. If no identifier is provided, one is generated on the fly (with a negative value).