Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.Text.BaseCodePageEncoding Class Referenceabstract

Classes

struct  CodePageDataFileHeader
 
struct  CodePageHeader
 
struct  CodePageIndex
 

Public Member Functions

unsafe int GetByteCount (char *chars, int count, System.Text.EncoderNLS encoder)
 
unsafe override int GetByteCount (char[] chars, int index, int count)
 
unsafe override int GetByteCount (string s)
 
unsafe override int GetByteCount (char *chars, int count)
 
virtual int GetByteCount (char[] chars)
 
unsafe int GetByteCount (string s, int index, int count)
 
virtual unsafe int GetByteCount (ReadOnlySpan< char > chars)
 
unsafe int GetBytes (char *chars, int charCount, byte *bytes, int byteCount, System.Text.EncoderNLS encoder)
 
unsafe override int GetBytes (string s, int charIndex, int charCount, byte[] bytes, int byteIndex)
 
unsafe override int GetBytes (char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex)
 
unsafe override int GetBytes (char *chars, int charCount, byte *bytes, int byteCount)
 
virtual byte[] GetBytes (char[] chars)
 
virtual byte[] GetBytes (char[] chars, int index, int count)
 
virtual byte[] GetBytes (string s)
 
unsafe byte[] GetBytes (string s, int index, int count)
 
virtual unsafe int GetBytes (ReadOnlySpan< char > chars, Span< byte > bytes)
 
unsafe int GetCharCount (byte *bytes, int count, System.Text.DecoderNLS decoder)
 
unsafe override int GetCharCount (byte[] bytes, int index, int count)
 
unsafe override int GetCharCount (byte *bytes, int count)
 
virtual int GetCharCount (byte[] bytes)
 
virtual unsafe int GetCharCount (ReadOnlySpan< byte > bytes)
 
unsafe int GetChars (byte *bytes, int byteCount, char *chars, int charCount, System.Text.DecoderNLS decoder)
 
unsafe override int GetChars (byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
 
unsafe override int GetChars (byte *bytes, int byteCount, char *chars, int charCount)
 
virtual char[] GetChars (byte[] bytes)
 
virtual char[] GetChars (byte[] bytes, int index, int count)
 
virtual unsafe int GetChars (ReadOnlySpan< byte > bytes, Span< char > chars)
 
unsafe override string GetString (byte[] bytes, int index, int count)
 
unsafe string GetString (byte *bytes, int byteCount)
 
unsafe string GetString (ReadOnlySpan< byte > bytes)
 
virtual string GetString (byte[] bytes)
 
override Decoder GetDecoder ()
 
override Encoder GetEncoder ()
 
virtual byte[] GetPreamble ()
 
virtual object Clone ()
 
bool IsAlwaysNormalized ()
 
virtual bool IsAlwaysNormalized (NormalizationForm form)
 
int GetMaxByteCount (int charCount)
 
int GetMaxCharCount (int byteCount)
 
override bool Equals ([NotNullWhen(true)] object? value)
 
override int GetHashCode ()
 

Static Public Member Functions

static byte[] Convert (Encoding srcEncoding, Encoding dstEncoding, byte[] bytes)
 
static byte[] Convert (Encoding srcEncoding, Encoding dstEncoding, byte[] bytes, int index, int count)
 
static void RegisterProvider (EncodingProvider provider)
 
static Encoding GetEncoding (int codepage)
 
static Encoding GetEncoding (int codepage, EncoderFallback encoderFallback, DecoderFallback decoderFallback)
 
static Encoding GetEncoding (string name)
 
static Encoding GetEncoding (string name, EncoderFallback encoderFallback, DecoderFallback decoderFallback)
 
static EncodingInfo[] GetEncodings ()
 
static Stream CreateTranscodingStream (Stream innerStream, Encoding innerStreamEncoding, Encoding outerStreamEncoding, bool leaveOpen=false)
 

Protected Member Functions

void LoadManagedCodePage ()
 
unsafe byte * GetNativeMemory (int iSize)
 
void ReadBestFitTable ()
 
virtual unsafe int GetByteCountFast (char *pChars, int charsLength, EncoderFallback fallback, out int charsConsumed)
 
unsafe int GetByteCountWithFallback (char *pCharsOriginal, int originalCharCount, int charsConsumedSoFar)
 
virtual unsafe int GetByteCountWithFallback (ReadOnlySpan< char > chars, int originalCharsLength, EncoderNLS encoder)
 
virtual unsafe int GetBytesFast (char *pChars, int charsLength, byte *pBytes, int bytesLength, out int charsConsumed)
 
unsafe int GetBytesWithFallback (char *pOriginalChars, int originalCharCount, byte *pOriginalBytes, int originalByteCount, int charsConsumedSoFar, int bytesWrittenSoFar)
 
virtual unsafe int GetBytesWithFallback (ReadOnlySpan< char > chars, int originalCharsLength, Span< byte > bytes, int originalBytesLength, EncoderNLS encoder)
 
virtual unsafe int GetCharCountFast (byte *pBytes, int bytesLength, DecoderFallback fallback, out int bytesConsumed)
 
unsafe int GetCharCountWithFallback (byte *pBytesOriginal, int originalByteCount, int bytesConsumedSoFar)
 
virtual unsafe int GetCharsFast (byte *pBytes, int bytesLength, char *pChars, int charsLength, out int bytesConsumed)
 
unsafe int GetCharsWithFallback (byte *pOriginalBytes, int originalByteCount, char *pOriginalChars, int originalCharCount, int bytesConsumedSoFar, int charsWrittenSoFar)
 
unsafe int GetCharsWithFallback (byte *pOriginalBytes, int originalByteCount, char *pOriginalChars, int originalCharCount, int bytesConsumedSoFar, int charsWrittenSoFar, DecoderNLS decoder)
 
virtual unsafe int GetCharsWithFallback (ReadOnlySpan< byte > bytes, int originalBytesLength, Span< char > chars, int originalCharsLength, DecoderNLS decoder)
 

Protected Attributes

int dataTableCodePage
 
int iExtraBytes
 
char[] arrayUnicodeBestFit
 
char[] arrayBytesBestFit
 
byte[] m_codePageHeader = new byte[48]
 
int m_firstDataWordOffset
 
int m_dataSize
 
SafeAllocHHandle safeNativeMemoryHandle
 

Static Protected Attributes

static Stream s_codePagesEncodingDataStream = GetEncodingDataStream("codepages.nlp")
 
static readonly object s_streamLock = new object()
 

Package Functions

 BaseCodePageEncoding (int codepage, int dataCodePage)
 
 BaseCodePageEncoding (int codepage, int dataCodePage, EncoderFallback enc, DecoderFallback dec)
 
char[] GetBestFitUnicodeToBytesData ()
 
char[] GetBestFitBytesToUnicodeData ()
 
void CheckMemorySection ()
 
void ThrowBytesOverflow (System.Text.EncoderNLS encoder, bool nothingEncoded)
 
void ThrowBytesOverflow ()
 
void ThrowCharsOverflow (System.Text.DecoderNLS decoder, bool nothingDecoded)
 
void ThrowCharsOverflow ()
 
virtual void SetDefaultFallbacks ()
 
virtual OperationStatus DecodeFirstRune (ReadOnlySpan< byte > bytes, out Rune value, out int bytesConsumed)
 
virtual OperationStatus EncodeRune (Rune value, Span< byte > bytes, out int bytesWritten)
 
virtual bool TryGetByteCount (Rune value, out int byteCount)
 

Static Package Functions

static unsafe void ReadCodePageDataFileHeader (Stream stream, byte[] codePageDataFileHeader)
 
static unsafe void ReadCodePageIndex (Stream stream, byte[] codePageIndex)
 
static unsafe void ReadCodePageHeader (Stream stream, byte[] codePageHeader)
 
static Stream GetEncodingDataStream (string tableName)
 
static unsafe int GetCodePageByteSize (int codePage)
 
static unsafe void ReadCodePageIndex (Stream stream, Span< byte > codePageIndex)
 
static unsafe EncodingInfo[] GetEncodings (CodePagesEncodingProvider provider)
 
static string GetLocalizedEncodingNameResource (int codePage)
 
static void ThrowConversionOverflow ()
 

Package Attributes

int _codePage
 
CodePageDataItem _dataItem
 
EncoderFallback encoderFallback
 
DecoderFallback decoderFallback
 

Properties

override string EncodingName [get]
 
override string WebName [get]
 
override string HeaderName [get]
 
override string BodyName [get]
 
static Encoding Default [get]
 
virtual ReadOnlySpan< byte > Preamble [get]
 
virtual int WindowsCodePage [get]
 
virtual bool IsBrowserDisplay [get]
 
virtual bool IsBrowserSave [get]
 
virtual bool IsMailNewsDisplay [get]
 
virtual bool IsMailNewsSave [get]
 
virtual bool IsSingleByte [get]
 
EncoderFallback EncoderFallback [get, set]
 
DecoderFallback DecoderFallback [get, set]
 
bool IsReadOnly [get, protected set]
 
static Encoding ASCII [get]
 
static Encoding Latin1 [get]
 
virtual int CodePage [get]
 
bool IsUTF8CodePage [get]
 
static Encoding Unicode [get]
 
static Encoding BigEndianUnicode [get]
 
static Encoding UTF7 [get]
 
static Encoding UTF8 [get]
 
static Encoding UTF32 [get]
 
static Encoding BigEndianUTF32 [get]
 

Private Member Functions

void ISerializable. GetObjectData (SerializationInfo info, StreamingContext context)
 
void LoadCodePageTables ()
 
unsafe bool FindCodePage (int codePage)
 
void GetDataItem ()
 
unsafe int GetByteCountWithFallback (char *pOriginalChars, int originalCharCount, int charsConsumedSoFar, EncoderNLS encoder)
 
unsafe int GetBytesWithFallback (char *pOriginalChars, int originalCharCount, byte *pOriginalBytes, int originalByteCount, int charsConsumedSoFar, int bytesWrittenSoFar, EncoderNLS encoder)
 
unsafe int GetCharCountWithFallback (byte *pOriginalBytes, int originalByteCount, int bytesConsumedSoFar, DecoderNLS decoder)
 
unsafe int GetCharCountWithFallback (ReadOnlySpan< byte > bytes, int originalBytesLength, DecoderNLS decoder)
 

Static Private Member Functions

static Encoding FilterDisallowedEncodings (Encoding encoding)
 

Private Attributes

string _encodingName
 
string _webName
 
bool _isReadOnly = true
 

Static Private Attributes

static readonly byte[] s_codePagesDataHeader = new byte[44]
 
static readonly UTF8Encoding.UTF8EncodingSealed s_defaultEncoding = new UTF8Encoding.UTF8EncodingSealed(encoderShouldEmitUTF8Identifier: false)
 

Detailed Description

Definition at line 10 of file BaseCodePageEncoding.cs.


The documentation for this class was generated from the following file: