New C# port from Suraj Supekar
[zxing.git] / csharp / common / DecoderResult.cs
diff --git a/csharp/common/DecoderResult.cs b/csharp/common/DecoderResult.cs
new file mode 100755 (executable)
index 0000000..8cbf31a
--- /dev/null
@@ -0,0 +1,86 @@
+/*\r
+* Copyright 2007 ZXing authors\r
+*\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+*      http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+*/\r
+using System;\r
+using ErrorCorrectionLevel = com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;\r
+namespace com.google.zxing.common\r
+{\r
+       \r
+       /// <summary> <p>Encapsulates the result of decoding a matrix of bits. This typically\r
+       /// applies to 2D barcode formats. For now it contains the raw bytes obtained,\r
+       /// as well as a String interpretation of those bytes, if applicable.</p>\r
+       /// \r
+       /// </summary>\r
+       /// <author>  Sean Owen\r
+       /// </author>\r
+       /// <author>www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source \r
+       /// </author>\r
+       public sealed class DecoderResult\r
+       {\r
+               public sbyte[] RawBytes\r
+               {\r
+                       get\r
+                       {\r
+                               return rawBytes;\r
+                       }\r
+                       \r
+               }\r
+               public System.String Text\r
+               {\r
+                       get\r
+                       {\r
+                               return text;\r
+                       }\r
+                       \r
+               }\r
+               public System.Collections.ArrayList ByteSegments\r
+               {\r
+                       get\r
+                       {\r
+                               return byteSegments;\r
+                       }\r
+                       \r
+               }\r
+               public ErrorCorrectionLevel ECLevel\r
+               {\r
+                       get\r
+                       {\r
+                               return ecLevel;\r
+                       }\r
+                       \r
+               }\r
+               \r
+               //UPGRADE_NOTE: Final was removed from the declaration of 'rawBytes '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"\r
+               private sbyte[] rawBytes;\r
+               //UPGRADE_NOTE: Final was removed from the declaration of 'text '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"\r
+               private System.String text;\r
+               //UPGRADE_NOTE: Final was removed from the declaration of 'byteSegments '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"\r
+               private System.Collections.ArrayList byteSegments;\r
+               //UPGRADE_NOTE: Final was removed from the declaration of 'ecLevel '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"\r
+               private ErrorCorrectionLevel ecLevel;\r
+               \r
+               public DecoderResult(sbyte[] rawBytes, System.String text, System.Collections.ArrayList byteSegments, ErrorCorrectionLevel ecLevel)\r
+               {\r
+                       if (rawBytes == null && text == null)\r
+                       {\r
+                               throw new System.ArgumentException();\r
+                       }\r
+                       this.rawBytes = rawBytes;\r
+                       this.text = text;\r
+                       this.byteSegments = byteSegments;\r
+                       this.ecLevel = ecLevel;\r
+               }\r
+       }\r
+}
\ No newline at end of file