%Library.Collate
Class %Library.Collate Extends %Library.Integer [ System = 2 ]
Datatype to handle validation/display of system collations
Methods
GetLocalNumber
ClassMethod GetLocalNumber() As %Integer
Return the number of the collation used in local arrays by the current process (e.g. 5)
GetLocalName
ClassMethod GetLocalName() As %String
Return the name of the collation used in local arrays by the current process
SetLocalNumber
ClassMethod SetLocalNumber(col As %Integer) As %Status
Set the collation used by the current process in local arrays
col = collation number (e.g. 5)
SetLocalName
ClassMethod SetLocalName(col As %String) As %Status
Set the collation used by the current process in local arrays
col = collation name
DisplayToLogical
ClassMethod DisplayToLogical(CollationName As %String, Flag As %Integer = 0) As %Integer [ ServerOnly = 0 ]
Convert external collation name or abbreviation to internal number.
Flag = 0 - Name to number (default)
Flag = 1 - Abbreviation to number
Flag = 2 - Name or Abbreviation to number
LogicalToDisplay
ClassMethod LogicalToDisplay(CollationNumber As %Integer, Flag As %Integer = 0) As %String [ ServerOnly = 0 ]
Convert internal collation number to external name or abbreviation.
Flag = 0 - Number to name (default)
Flag = 1 - Number to abbreviation
Flag = 2 - Show Old collations
IsValid
ClassMethod IsValid(%Val As %RawString) As %Status [ CodeMode = expression, Internal, ServerOnly = 0 ]
GetSystemDefaultName
ClassMethod GetSystemDefaultName() As %String
Return the System default collation name.
GetSystemDefaultNumber
ClassMethod GetSystemDefaultNumber() As %String
Return the System default collation number.
IsValidName
ClassMethod IsValidName(CollationName As %String, Flag As %Integer = 0, Loaded As %Boolean = 1) As %Boolean [ Internal ]
Verifies that the collation name is valid, and loaded
Flag = 0 - Validate name (default)
Flag = 1 - Validate abbreviation
Flag = 2 - Validate name or abbreviation
Loaded = 0 - Don't validate the table is loaded
Loaded = 1 - Validate the table is loaded
IsValidNumber
ClassMethod IsValidNumber(CollationNumber As %Integer, Loaded As %Boolean = 1) As %Boolean [ Internal ]
Verifies that the collation number is valid.
Loaded = 0 - Don't validate the table is loaded
Loaded = 1 - Validate the table is loaded
MakeArray
ClassMethod MakeArray(ByRef Array As %Binary, IsLoaded As %Boolean = 1, OldCollations As %Boolean = 0, Format As %Integer = 1) As %Status [ Internal ]
Creates an array with the desired collations
Helper method used by other methods and ^COLLATE
Parameters:
- Array = Name of the array
- IsLoaded = 0: all collations, 1: only loaded collations
- OldCollations = 0: only new collations, 1: include old collations
- Format=0: Array(num)="status;num;name"
- Format=1: Array(name)=$LB(name,abbrv,num,status)
- Format=2: Array(num)="name"
CollationListExecute
ClassMethod CollationListExecute(ByRef qHandle As %Binary, IsLoaded As %Boolean = 1, OldCollations As %Boolean = 0) As %Status [ Internal ]
Returns a list of collations
Pass IsLoaded=1 to only return loaded collations
CollationListFetch
ClassMethod CollationListFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ Internal ]
CollationListClose
ClassMethod CollationListClose(ByRef qHandle As %Binary) As %Status [ Internal, PlaceAfter = CollationListExecute ]