diff --git a/source/Cosmos.System2/Text/EncodingTable.cs b/source/Cosmos.System2/Text/EncodingTable.cs
index 928b09778..d5148cc9e 100644
--- a/source/Cosmos.System2/Text/EncodingTable.cs
+++ b/source/Cosmos.System2/Text/EncodingTable.cs
@@ -3,15 +3,24 @@ using System.Text;
using Cosmos.Debug.Kernel;
namespace Cosmos.System.ExtendedASCII
-{
+{
/*
* Ideally we should use Dictionary or HashTable here but are yet not working in Cosmos so I have done
* this replacement class for now...
*/
+ ///
+ /// EncodingTable class. Used to manage codepage list.
+ ///
internal static class EncodingTable
{
+ ///
+ /// Debugger inctanse of the "System" with the "EncodingTable" tag.
+ ///
private static Debugger mDebugger = new Debugger("System", "EncodingTable");
+ ///
+ /// Create new inctanse of the class.
+ ///
static EncodingTable()
{
mDebugger.SendInternal("Inizializing Encoding Table");
@@ -20,11 +29,25 @@ namespace Cosmos.System.ExtendedASCII
Add(858, "IBM0858", new CP858Enconding());
}
+ ///
+ /// Struct which used to hold description and encoding.
+ ///
private struct values
{
+ ///
+ /// Description.
+ ///
public string desc;
+ ///
+ /// Encoding.
+ ///
public Encoding encoding;
+ ///
+ /// Create new inctanse of the struct.
+ ///
+ /// Description.
+ /// Encoding.
public values(string desc, Encoding encoding)
{
this.desc = desc;
@@ -32,19 +55,46 @@ namespace Cosmos.System.ExtendedASCII
}
};
+ ///
+ /// Max codepage cache size.
+ ///
const int MaxCodepageChacheSize = 2048;
+ ///
+ /// Codepage cache.
+ ///
static values[] CodepageCache = new values[MaxCodepageChacheSize];
+ ///
+ /// Add encoding to the encoding table.
+ ///
+ /// Codepage.
+ /// Desciption.
+ /// Encoding.
public static void Add(int codepage, string desc, Encoding encoding)
{
mDebugger.SendInternal($"Adding codepage {codepage} desc {desc}");
CodepageCache[codepage] = new values(desc, encoding);
}
+ ///
+ /// Get description, using codepage.
+ ///
+ /// Codepage.
+ /// string value.
public static string GetDescription(int codepage) => CodepageCache[codepage].desc;
+ ///
+ /// Get encoding, using codepage.
+ ///
+ /// Codepage.
+ /// Encoding value.
public static Encoding GetEncoding(int codepage) => CodepageCache[codepage].encoding;
+ ///
+ /// Get code page from description.
+ ///
+ /// Description.
+ /// int value, -1 if not found.
public static int GetCodePageFromDesc(string desc)
{
for (int idx = 0; idx < MaxCodepageChacheSize; idx++)