Elight.Utility/Files/DataMatrix/DmtxMessage.cs

(开头部分) 15KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;

namespace DataMatrix.net
{
	// Token: 0x02000023 RID: 35
	internal class DmtxMessage
	{
		// Token: 0x060001B3 RID: 435 RVA: 0x0000E128 File Offset: 0x0000C328
		internal DmtxMessage(DmtxSymbolSize sizeIdx, DmtxFormat symbolFormat)
		{
			if (symbolFormat != DmtxFormat.Matrix && symbolFormat != DmtxFormat.Mosaic)
			{
				throw new ArgumentException("Only DmtxFormats Matrix and Mosaic are currently supported");
			}
			int symbolAttribute = DmtxCommon.GetSymbolAttribute(DmtxSymAttribute.DmtxSymAttribMappingMatrixRows, sizeIdx);
			int symbolAttribute2 = DmtxCommon.GetSymbolAttribute(DmtxSymAttribute.DmtxSymAttribMappingMatrixCols, sizeIdx);
			this.Array = new byte[symbolAttribute2 * symbolAttribute];
			int num = DmtxCommon.GetSymbolAttribute(DmtxSymAttribute.DmtxSymAttribSymbolDataWords, sizeIdx) + DmtxCommon.GetSymbolAttribute(DmtxSymAttribute.DmtxSymAttribSymbolErrorWords, sizeIdx);
			this.Code = new byte[num];
			this.Output = new byte[10 * num];
		}

		// Token: 0x060001B4 RID: 436 RVA: 0x0000E1A8 File Offset: 0x0000C3A8
		internal void DecodeDataStream(DmtxSymbolSize sizeIdx, byte[] outputStart)
		{
			bool flag = false;
			this.Output = (outputStart ?? this.Output);
			this._outputIdx = 0;
			byte[] code = this.Code;
			int symbolAttribute = DmtxCommon.GetSymbolAttribute(DmtxSymAttribute.DmtxSymAttribSymbolDataWords, sizeIdx);
			if (code[0] == DmtxConstants.DmtxChar05Macro || code[0] == DmtxConstants.DmtxChar06Macro)
			{
				this.PushOutputMacroHeader(code[0]);
				flag = true;
			}
			int i = 0;
			while (i < symbolAttribute)
			{
				DmtxScheme encodationScheme = DmtxMessage.GetEncodationScheme(this.Code[i]);
				if (encodationScheme != DmtxScheme.DmtxSchemeAscii)
				{
					i++;
				}
				switch (encodationScheme)
				{
				case DmtxScheme.DmtxSchemeAscii:
					i = this.DecodeSchemeAscii(i, symbolAttribute);
					break;
				case DmtxScheme.DmtxSchemeC40:
				case DmtxScheme.DmtxSchemeText:
					i = this.DecodeSchemeC40Text(i, symbolAttribute, encodationScheme);
					break;
				case DmtxScheme.DmtxSchemeX12:
					i = this.DecodeSchemeX12(i, symbolAttribute);
					break;
				case DmtxScheme.DmtxSchemeEdifact:
					i = this.DecodeSchemeEdifact(i, symbolAttribute);
					break;
				case DmtxScheme.DmtxSchemeBase256:
					i = this.DecodeSchemeBase256(i, symbolAttribute);
后面还有 486 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。