Photon Fusion 1.1.12

Public Member Functions | Static Public Member Functions | Properties | List of all members
NetworkString< Size > Class Template Reference

Fixed-size UTF32 string. All operations are alloc-free, except for converting to System.String. More...

Inherits INetworkString, INetworkStruct, IEquatable< NetworkString< Size >>, and IEnumerable< char >.

Public Member Functions

int Compare (NetworkString< Size > s)
 
int Compare (ref NetworkString< Size > s)
 
int Compare (string s)
 
int Compare< OtherSize > (NetworkString< OtherSize > other)
 
int Compare< OtherSize > (ref NetworkString< OtherSize > other)
 
bool Contains (char c)
 
bool Contains (string str)
 
bool Contains (uint codePoint)
 
bool Contains< OtherSize > (NetworkString< OtherSize > str)
 
bool Contains< OtherSize > (ref NetworkString< OtherSize > str)
 
bool EndsWith (string s)
 
bool EndsWith< OtherSize > (ref NetworkString< OtherSize > other)
 
bool Equals (NetworkString< Size > other)
 
override bool Equals (object obj)
 
bool Equals (ref NetworkString< Size > other)
 
bool Equals (string s)
 
bool Equals< OtherSize > (NetworkString< OtherSize > other)
 
bool Equals< OtherSize > (ref NetworkString< OtherSize > other)
 
bool Get (ref string cache)
 Checks if cache is equivalent and if not converts to UTF16 and stores the result in cache . More...
 
int GetCharCount ()
 Calculates the length of the equivalent UTF16 string. More...
 
UTF32Tools.CharEnumerator GetEnumerator ()
 
IEnumerator< char > IEnumerable< char >. GetEnumerator ()
 
IEnumerator IEnumerable. GetEnumerator ()
 
override int GetHashCode ()
 
int IndexOf (char c, int startIndex, int count)
 
int IndexOf (char c, int startIndex=0)
 
int IndexOf (string str, int startIndex, int count)
 
int IndexOf (string str, int startIndex=0)
 
int IndexOf (uint codePoint, int startIndex, int count)
 
int IndexOf (uint codePoint, int startIndex=0)
 
int IndexOf< OtherSize > (NetworkString< OtherSize > str, int startIndex, int count)
 
int IndexOf< OtherSize > (NetworkString< OtherSize > str, int startIndex=0)
 
int IndexOf< OtherSize > (ref NetworkString< OtherSize > str, int startIndex, int count)
 
int IndexOf< OtherSize > (ref NetworkString< OtherSize > str, int startIndex=0)
 
bool Set (string value)
 Converts value to UTF32 string and stores it internally. More...
 
bool StartsWith (string s)
 
bool StartsWith< OtherSize > (ref NetworkString< OtherSize > other)
 
NetworkString< Size > Substring (int startIndex)
 
NetworkString< Size > Substring (int startIndex, int length)
 
NetworkString< Size > ToLower ()
 
override string ToString ()
 
NetworkString< Size > ToUpper ()
 

Static Public Member Functions

static int GetCapacity< Size > ()
 
static implicit operator NetworkString< Size > (string str)
 
static bool operator!= (NetworkString< Size > a, NetworkString< Size > b)
 
static bool operator!= (NetworkString< Size > a, string b)
 
static bool operator!= (string a, NetworkString< Size > b)
 
static bool operator== (NetworkString< Size > a, NetworkString< Size > b)
 
static bool operator== (NetworkString< Size > a, string b)
 
static bool operator== (string a, NetworkString< Size > b)
 

Properties

int Capacity [get]
 Maximum UTF32 string length. More...
 
int Length [get]
 Number of UTF32 scalars. It is equal or less than GetCharCount or the length of Value, because those use UTF16 encoding, which needs two characters to encode some values. More...
 
ref uint this[int index] [get]
 Returns UTF32 scalar at index position. To iterate over characters, use GetEnumerator. More...
 
string Value [get, set]
 Converts to/from regular UTF16 string. Setter is alloc-free. Use Get(ref string, bool) to get possibly alloc-free conversion. More...
 

Detailed Description

Fixed-size UTF32 string. All operations are alloc-free, except for converting to System.String.

Template Parameters
Size
Type Constraints
Size :unmanaged 
Size :IFixedStorage 

Member Function Documentation

◆ Get()

bool Get ( ref string  cache)

Checks if cache is equivalent and if not converts to UTF16 and stores the result in cache .

Parameters
cache
ignoreCase
Returns
False if no conversion was performed, true otherwise.

◆ GetCharCount()

int GetCharCount ( )

Calculates the length of the equivalent UTF16 string.

Returns

◆ Set()

bool Set ( string  value)

Converts value to UTF32 string and stores it internally.

Parameters
value
Returns
False if value was too long to fit and had to be trimmed.

Property Documentation

◆ Capacity

int Capacity
get

Maximum UTF32 string length.

◆ Length

int Length
get

Number of UTF32 scalars. It is equal or less than GetCharCount or the length of Value, because those use UTF16 encoding, which needs two characters to encode some values.

◆ this[int index]

ref uint this[int index]
get

Returns UTF32 scalar at index position. To iterate over characters, use GetEnumerator.

Parameters
index
Returns

◆ Value

string Value
getset

Converts to/from regular UTF16 string. Setter is alloc-free. Use Get(ref string, bool) to get possibly alloc-free conversion.