DIRECTORY IO USING [STREAM], Rope USING [ROPE], Tioga USING [CharSet, Looks, noLooks, allLooks, PropList], TiogaAccess USING [Writer]; IOTioga: CEDAR DEFINITIONS ~ BEGIN STREAM: TYPE ~ IO.STREAM; ROPE: TYPE ~ Rope.ROPE; CharSet: TYPE ~ Tioga.CharSet; SetCharSet: PROC [self: STREAM, charSet: CharSet ¬ 0]; GetCharSet: PROC [self: STREAM] RETURNS [CharSet]; Looks: TYPE ~ Tioga.Looks; noLooks: Looks ~ Tioga.noLooks; allLooks: Looks ~ Tioga.allLooks; LooksFromRope: PROC [ROPE] RETURNS [Looks]; RopeFromLooks: PROC [Looks] RETURNS [ROPE]; ChangeLooks: PROC [self: STREAM, remove, add: Looks ¬ noLooks]; AddLooks: PROC [self: STREAM, looks: Looks] ~ INLINE { ChangeLooks[self: self, remove: noLooks, add: looks] }; RemoveLooks: PROC [self: STREAM, looks: Looks] ~ INLINE { ChangeLooks[self: self, remove: looks, add: noLooks] }; SetLooks: PROC [self: STREAM, looks: Looks] ~ INLINE { ChangeLooks[self: self, remove: allLooks, add: looks] }; ClearLooks: PROC [self: STREAM] ~ INLINE { ChangeLooks[self: self, remove: allLooks, add: noLooks] }; GetLooks: PROC [self: STREAM] RETURNS [Looks]; PropList: TYPE ~ Tioga.PropList; PropPut: PROC [propList: PropList, key: REF, val: REF] RETURNS [PropList]; PropGet: PROC [propList: PropList, key: REF] RETURNS [val: REF]; SetCharProps: PROC [self: STREAM, propList: PropList]; GetCharProps: PROC [self: STREAM] RETURNS [PropList]; SetNodeProp: PROC [self: STREAM, name: ATOM, value: REF]; GetNodeProp: PROC [self: STREAM, name: ATOM] RETURNS [value: REF]; MapPropsAction: TYPE ~ PROC [name: ATOM, value: REF] RETURNS [quit: BOOL ¬ FALSE]; MapNodeProps: PROC [self: STREAM, action: MapPropsAction] RETURNS [BOOL]; FormatFromRope: PROC [ROPE] RETURNS [ATOM]; SetFormat: PROC [self: STREAM, format: ATOM]; GetFormat: PROC [self: STREAM] RETURNS [ATOM]; CommentFromBool: PROC [BOOL] RETURNS [REF]; BoolFromComment: PROC [REF] RETURNS [BOOL]; SetComment: PROC [self: STREAM, comment: BOOL]; GetComment: PROC [self: STREAM] RETURNS [BOOL]; SetLevel: PROC [self: STREAM, level: CARDINAL]; GetLevel: PROC [self: STREAM] RETURNS [level: CARDINAL]; Break: PROC [self: STREAM]; CreateTiogaAccessStream: PROC RETURNS [STREAM]; WriterFromStream: PROC [self: STREAM] RETURNS [TiogaAccess.Writer]; Signal: SIGNAL [code: ATOM, msg: ROPE]; END. Ύ IOTioga.mesa Copyright Σ 1990, 1991, 1992 by Xerox Corporation. All rights reserved. Bier, January 15, 1990 5:20:07 pm PST Doug Wyatt, January 30, 1992 3:16 pm PST Contents: Some IO streams produce Tioga files as output. These routines allow client control of the character set, character looks, character properties, node properties, and node nesting levels of the Tioga document as it is emitted. Character set Sets the character set. This is normally zero, but may be changed to refer to special characters outside the usual CHAR range (see the Xerox Character Code Standard). Subsequent characters sent to the stream will have the 16-bit character code (charSet*256+ORD[char]). Returns the current character set. Looks Turns the rope into Looks. The result has a TRUE bit for every Look character appearing in the rope. Other characters in the rope are ignored. Case is important (use lower case)! Turns the Looks into a rope. LooksFromRope[RopeFromLooks[x]]=x. First removes, then adds the specified looks (compare TextLooksSupport.ModifyLooks). Subsequent characters sent to the stream will have the new looks. Returns the current looks. Character properties Note: clients of this interface must regard a PropList as immutable! Returns a PropList containing (key, val). Get[Put[propList, key, val], key]=val. Returns val associated with key, NIL if none. Uses REF equality to compare keys. Sets the list of character properties. The supplied propList must not later be modified. Subsequent characters sent to the stream will have the new properties. Returns the current list of character properties. Node properties Sets a node property for the current node. Returns the current node properties. same as TextEdit.MapPropsAction Calls action for each of the current node properties. Turns the rope into a suitable $Format property value (forces lower case). Sets the $Format property of the current node. Equivalent to SetNodeProp[self, $Format, format]. Gets the $Format property of the current node. Equivalent to NARROW[GetNodeProp[self, $Format], ATOM]. Turns the boolean into a suitable $Comment property value (by table lookup). Turns a $Comment property value into a boolean. Sets the $Comment property of the current node. Equivalent to SetNodeProp[self, $Comment, CommentFromBool[comment]]. Gets the $Comment property of the current node. Equivalent to BoolFromComment[GetNodeProp[self, $Comment]]. Tree structure Sets the nesting level of the current node, which must not exceed the nesting level of the node that precedes it by more than 1. <> Returns the current (absolute) nesting level. Creates a new node after the last character that was sent to self. Characters added to self after this call will be placed in this new node. The new node has the same nesting level as the previous node. Use SetLevel to change the nesting level. Stream creation Creates an IOTioga stream directed at a TiogaAccess.Writer. Typical use: stream: STREAM ~ IOTioga.CreateTiogaAccessStream[]; EmitDocument[stream]; -- can use all the IOTioga operations TiogaAccess.WriteFile[IOTioga.WriterFromStream[stream], "Foo.tioga"]; Returns the TiogaAccess.Writer associated with the stream. Exceptions Κͺ–(cedarcode) style•NewlineDelimiter ™code™ Kšœ Οeœ=™HKšœ%™%K™(K™Kšœμ™μK™—šΟk ˜ Kšžœžœžœ˜Kšœžœžœ˜Kšœžœ/˜:Kšœ žœ ˜—K˜šΟnœžœž œž˜"K˜Kšžœžœžœžœ˜Kšžœžœžœ˜—head™ šœ žœ˜K˜—šŸ œžœžœ˜6Kšœtžœ‹žœ™ŽK˜—šŸ œžœžœžœ ˜2K™"K™——™šœžœ˜Kšœ˜Kšœ!˜!K˜—šŸ œžœžœžœ ˜+Kšœ-žœ„™΅K™—šŸ œžœ žœžœ˜+K™@K˜—šŸ œžœžœ ˜?KšœT™TšœA™AK™——šŸœžœžœ˜+šœžœ:˜BK™——šŸ œžœžœ˜.Kšœžœ:˜BK™—šŸœžœžœ˜+Kšœžœ;˜CK™—šŸ œžœžœ˜Kšœžœ=˜EK™—šŸœžœžœžœ ˜.K™K™——™™DK˜—šœ žœ˜ K™—š Ÿœžœžœžœžœ ˜JKšœQ™QK™—š Ÿœžœžœžœžœ˜@Kšœ!žœžœ™QK˜—šŸ œžœžœ˜6KšœY™YKšœF™FK™—šŸ œžœžœžœ ˜5Kšœ1™1K™——™š Ÿ œžœžœžœ žœ˜9Kšœ*™*K™—š Ÿ œžœžœžœžœ žœ˜BKšœ$™$K™—šœžœžœžœ žœžœžœžœ˜RKšœ™K˜—š Ÿ œžœžœžœžœ˜IKšœ5™5K™—K˜š Ÿœžœžœžœžœ˜+KšœJ™JK™—šŸ œžœžœ žœ˜-Kšœ.™.K™1K™—š Ÿ œžœžœžœžœ˜.Kšœ.™.Kšœžœžœ™7K™—K˜š Ÿœžœžœžœžœ˜+KšœL™LK™—š Ÿœžœžœžœžœ˜+Kšœ/™/K™—šŸ œžœžœ žœ˜/Kšœ/™/K™DK™—š Ÿ œžœžœžœžœ˜/Kšœ/™/K™;K™——™šŸœžœžœ žœ˜/Kšœ–™–K™—š Ÿœžœžœžœ žœ˜8Kšœ-™-K™—šŸœžœžœ˜Kšœχ™χK™——™šŸœžœžœžœ˜/šœH™HKšœžœ%™3K™;K™EK™——šŸœžœžœžœ˜CK™:——™ KšŸœžœžœžœ˜'—K™Kšžœ˜—…—ζN