Oberon || Library || Module Index || Search Engine || Definition || Module
CONST separator = "/";
TYPE Path = POINTER TO PathRec;
TYPE PathRec =
RECORD
(Objects.ObjectRec)
component: Names.Name;
next: Path;
END;
TYPE ErrorCode = SHORTINT;
TYPE ErrorEvent = POINTER TO ErrorEventRec;
TYPE ErrorEventRec =
RECORD
(Events.EventRec)
errorcode: ErrorCode;
END;
VAR errormsg: ARRAY errorcodes OF Events.Message;
VAR error: Events.EventType;
PROCEDURE Convert(path: ARRAY OF CHAR): Path;
PROCEDURE GetNode(path: ARRAY OF CHAR;
auth: Shards.Lid; errors: RelatedEvents.Object;
VAR subnode: Names.Node): BOOLEAN;
PROCEDURE GetNodeN(node: Names.Node; path: ARRAY OF CHAR;
auth: Shards.Lid; errors: RelatedEvents.Object;
VAR subnode: Names.Node): BOOLEAN;
PROCEDURE Insert(path: ARRAY OF CHAR; subnode: Names.Node;
auth: Shards.Lid; errors: RelatedEvents.Object): BOOLEAN;
PROCEDURE InsertN(node: Names.Node; path: ARRAY OF CHAR;
subnode: Names.Node;
auth: Shards.Lid; errors: RelatedEvents.Object): BOOLEAN;
PROCEDURE Delete(path: ARRAY OF CHAR;
auth: Shards.Lid; errors: RelatedEvents.Object): BOOLEAN;
PROCEDURE DeleteN(node: Names.Node; path: ARRAY OF CHAR;
auth: Shards.Lid; errors: RelatedEvents.Object): BOOLEAN;
Paths are evaluated from left to right as a sequence of Names.GetNode calls until exactly one component remains unresolved, which becomes the name argument to the requested procedure.
Convert simply converts a string to a Path structure.
success := Paths.Insert("etc/example", subnode, auth, errors)
is essentially equivalent to:
ConstStrings.Create(etcString, "etc"); ConstStrings.Create(exampleString, "example"); success := Names.GetNode(Names.root, etcString, auth, tmpnode) & Names.Insert(tmpnode, subnode, exampleString, auth)except for the redirection of error events.
Oberon || Library || Module Index || Search Engine || Definition || Module