<> <> <> <> <> <> DIRECTORY <> Basics USING [Comparison]; NSString: CEDAR DEFINITIONS = BEGIN <<-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---->> <> <<-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---->> Character: TYPE = MACHINE DEPENDENT RECORD [chset, code: BYTE]; Characters: TYPE = REF CharactersRep; CharactersRep: TYPE = RECORD [data: SEQUENCE length: CARDINAL OF Character]; String: TYPE = REF TEXT; StringRep: TYPE ~ TEXT; <> SubString: TYPE = REF SubStringDescriptor; SubStringDescriptor: TYPE = RECORD [base: String, offset, length: CARDINAL]; <> Relation: TYPE = Basics.Comparison; MesaString: TYPE = REF TEXT; <<-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---->> <> <<-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---->> nullString: String = NIL; <> <<-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---->> <> <<-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---->> <> LogicalLength: PROC [s: String] RETURNS [CARDINAL]; <> WordsForString: PROC [bytes: CARDINAL] RETURNS [CARDINAL]; <> <> AppendCharacter: PROC [to: String, from: Character] RETURNS [String]; AppendString: PROC [to: String, from: String] RETURNS [String]; <> AppendSubString: PROC [to: String, from: SubString] RETURNS [String]; <> CompareStrings: PROC [s1, s2: String, ignoreCase: BOOLEAN _ TRUE] RETURNS [Relation]; <> CompareSubStrings: PROC [s1, s2: SubString, ignoreCase: BOOLEAN _ TRUE] RETURNS [Relation]; <> DeleteSubString: PROC [s: SubString] RETURNS [String]; <> EqualCharacter: PROC [c: Character, s: String, index: CARDINAL] RETURNS [BOOLEAN]; <> EqualString, EqualStrings: PROC [s1, s2: String] RETURNS [BOOLEAN] = INLINE { RETURN[CompareStrings[s1, s2, FALSE] = equal]}; <> EqualSubString, EqualSubStrings: PROC [s1, s2: SubString] RETURNS [BOOLEAN] = INLINE {RETURN[CompareSubStrings[s1, s2, FALSE] = equal]}; <> EquivalentString, EquivalentStrings: PROC [s1, s2: String] RETURNS [BOOLEAN] = INLINE {RETURN[CompareStrings[s1, s2] = equal]}; <> EquivalentSubString, EquivalentSubStrings: PROC [s1, s2: SubString] RETURNS [BOOLEAN] = INLINE {RETURN[CompareSubStrings[s1, s2] = equal]}; <> ScanForCharacter: PROC [c: Character, s: String, start: CARDINAL _ 0] RETURNS [CARDINAL]; <> UpperCase, LowerCase: PROC [c: Character] RETURNS [Character]; WellFormed: PROC [s: String] RETURNS [BOOLEAN]; <> <> MakeString: PROC [bytes: CARDINAL] RETURNS [String]; <> FreeString: PROC [s: String]; <> CopyString: PROC [s: String] RETURNS [String]; <> <> ExpandString: PROCEDURE [s: String] RETURNS [Characters]; <> FreeCharacters: PROCEDURE [c: Characters]; <> <> TruncateString: PROC [s: String, bytes: CARDINAL] RETURNS [String]; <> CompareStringsAndStems: PROC [s1, s2: String, ignoreCase: BOOLEAN _ TRUE] RETURNS [relation: Relation, equalStems: BOOLEAN]; <> CompareStringsTruncated: PROC [s1, s2: String, trunc1, trunc2: BOOLEAN _ FALSE, ignoreCase: BOOLEAN _ TRUE] RETURNS [Relation]; <*.>> <> AppendDecimal: PROC [s: String, n: INTEGER] RETURNS [String]; <> AppendOctal: PROC [s: String, n: UNSPECIFIED] RETURNS [String]; <> AppendLongNumber: PROC [s: String, n: LONG UNSPECIFIED, radix: CARDINAL _ 10] RETURNS [String]; <> AppendLongDecimal: PROC [s: String, n: LONG INTEGER] RETURNS [String]; <> AppendNumber: PROC [s: String, n: UNSPECIFIED, radix: CARDINAL _ 10] RETURNS [String]; <> StringToDecimal: PROC [s: String] RETURNS [INTEGER] = INLINE { RETURN[StringToNumber[s, 10]]}; <> StringToOctal: PROC [s: String] RETURNS [WORD] = INLINE {RETURN[StringToNumber[s, 8]]}; StringToLongNumber: PROC [s: String, radix: CARDINAL _ 10] RETURNS [LONG UNSPECIFIED]; <> StringToNumber: PROC [s: String, radix: CARDINAL _ 10] RETURNS [UNSPECIFIED]; <> <> StringFromMesaString: PROC [s: MesaString] RETURNS [String]; <> AppendToMesaString: PROC [to: MesaString, from: String]; <> ValidAsMesaString: PROC [s: String] RETURNS [BOOLEAN]; <> <> <> <= the length of the string. The maxlength field may, of course, be set by the client after deserialization to match the length field.>> <<-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---->> <> <<-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---->> InvalidNumber: ERROR; -- raised by StringToDecimal if the characters do not represent a decimal number. This is a SIGNAL is String.mesa InvalidString: ERROR; <> <> StringBoundsFault: SIGNAL [old: String, increaseBy: CARDINAL] RETURNS [new: String]; <> END. -- of NSString LOG ( date - person - action ) February 26, 1981 - Kabcenell - Creation. - - - - FILING 5.0 - - - - 1-Mar-82 14:07:59 - Hamilton - Add SubString and StringToDecimal stuff. 19-Apr-82 15:59:12 - Hamilton - Add remaining ops that String.mesa has and NSString.mesa doesn't. August 2, 1982 - Hanzel - Define Characters, ExpandString, and Freecharacters in support of character-level access. August 5, 1982 - Kiser - Added increaseBy to StringBoundsFault. 5-Aug-82 19:18:52 - Kabcenell - Changed order of arguments in ExpandString and FreeCharacters; made Characters a LONG DESCRIPTOR. 2-Sep-82 15:50:35 - Kiser - Made internal structure of Character visible; added DescribeString. 22-Sep-82 21:00:195 - Kiser - Changed NOTE comment: StringBoundsFault always leaves a well-formed string.