summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Globalization/EncodingDataItem.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Globalization/EncodingDataItem.cs')
-rw-r--r--src/mscorlib/src/System/Globalization/EncodingDataItem.cs77
1 files changed, 46 insertions, 31 deletions
diff --git a/src/mscorlib/src/System/Globalization/EncodingDataItem.cs b/src/mscorlib/src/System/Globalization/EncodingDataItem.cs
index 89ac780587..b049eaf45d 100644
--- a/src/mscorlib/src/System/Globalization/EncodingDataItem.cs
+++ b/src/mscorlib/src/System/Globalization/EncodingDataItem.cs
@@ -2,12 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-namespace System.Globalization {
- using System.Text;
- using System.Runtime.Remoting;
- using System;
- using System.Security;
+using System.Text;
+using System.Runtime.Remoting;
+using System;
+using System.Security;
+namespace System.Globalization
+{
//
// Data item for EncodingTable. Along with EncodingTable, they are used by
// System.Text.Encoding.
@@ -16,18 +17,19 @@ namespace System.Globalization {
// where our required information is found. We load the code page, flags and uiFamilyCodePage
// immediately because they don't require creating an object. Creating any of the string
// names is delayed until somebody actually asks for them and the names are then cached.
-
+
[Serializable]
internal class CodePageDataItem
{
- internal int m_dataIndex;
- internal int m_uiFamilyCodePage;
+ internal int m_dataIndex;
+ internal int m_uiFamilyCodePage;
internal String m_webName;
internal String m_headerName;
internal String m_bodyName;
- internal uint m_flags;
-
- unsafe internal CodePageDataItem(int dataIndex) {
+ internal uint m_flags;
+
+ unsafe internal CodePageDataItem(int dataIndex)
+ {
m_dataIndex = dataIndex;
m_uiFamilyCodePage = EncodingTable.codePageDataPtr[dataIndex].uiFamilyCodePage;
m_flags = EncodingTable.codePageDataPtr[dataIndex].flags;
@@ -38,8 +40,8 @@ namespace System.Globalization {
if (pStrings[0] == '|') // |str1|str2|str3
{
int start = 1;
-
- for (int i = 1; true; i ++)
+
+ for (int i = 1; true; i++)
{
sbyte ch = pStrings[i];
@@ -50,7 +52,7 @@ namespace System.Globalization {
return new String(pStrings, start, i - start);
}
- index --;
+ index--;
start = i + 1;
if (ch == 0)
@@ -68,41 +70,54 @@ namespace System.Globalization {
}
}
- unsafe public String WebName {
- get {
- if (m_webName==null) {
+ unsafe public String WebName
+ {
+ get
+ {
+ if (m_webName == null)
+ {
m_webName = CreateString(EncodingTable.codePageDataPtr[m_dataIndex].Names, 0);
}
return m_webName;
}
}
-
- public virtual int UIFamilyCodePage {
- get {
+
+ public virtual int UIFamilyCodePage
+ {
+ get
+ {
return m_uiFamilyCodePage;
}
}
-
- unsafe public String HeaderName {
- get {
- if (m_headerName==null) {
+
+ unsafe public String HeaderName
+ {
+ get
+ {
+ if (m_headerName == null)
+ {
m_headerName = CreateString(EncodingTable.codePageDataPtr[m_dataIndex].Names, 1);
}
return m_headerName;
}
}
-
- unsafe public String BodyName {
- get {
- if (m_bodyName==null) {
+
+ unsafe public String BodyName
+ {
+ get
+ {
+ if (m_bodyName == null)
+ {
m_bodyName = CreateString(EncodingTable.codePageDataPtr[m_dataIndex].Names, 2);
}
return m_bodyName;
}
- }
+ }
- unsafe public uint Flags {
- get {
+ unsafe public uint Flags
+ {
+ get
+ {
return (m_flags);
}
}