PostSharp SDK 6.10 / / Class Reference / Post­Sharp.​Sdk.​Code­Model Namespace / Literal­String Structure

LiteralString Structure

Encapsulates a read-only array of characters.

Namespace:  PostSharp.Sdk.CodeModel
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 6.10.14.0 (6.10.14.0)
Syntax
C#
public struct LiteralString : IEquatable<LiteralString>

The LiteralString type exposes the following members.

Constructors
  NameDescription
Public methodLiteralString(Char[])
Initializes a new LiteralString from an array of characters.
Public methodLiteralString(String)
Initializes a new LiteralString from a string.
Properties
  NameDescription
Public propertyIsNull
Determines whether the current instance represents a null string.
Public propertyLength
Gets the string length.
Methods
  NameDescription
Public methodEquals(Object)
Indicates whether this instance and a specified object are equal.
(Overrides ValueType.Equals(Object).)
Public methodEquals(LiteralString)
Indicates whether the current object is equal to another object of the same type.
Public methodGetChar
Gets a character given its position.
Public methodGetHashCode
Returns the hash code for this instance.
(Overrides ValueType.GetHashCode().)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Convert this instance to a String.
(Overrides ValueType.ToString().)
Operators
  NameDescription
Public operatorStatic memberEquality
Determines whether two strings are equal.
Public operatorStatic memberImplicit(String to LiteralString)
Converts a String to a LiteralString.
Public operatorStatic memberInequality
Determines whether two strings are different.
Fields
  NameDescription
Public fieldStatic memberNull
Represents a null LiteralString.
Remarks
We use LiteralString instead of String because String sometimes transforms the array of characters, but we require binary identity between what we read and what we writer.
See Also