Skip to content

Commit

Permalink
dotnet: remove publicly visible BarcodeFormats.Invalid enum value
Browse files Browse the repository at this point in the history
  • Loading branch information
axxel committed Jan 31, 2024
1 parent 6861b82 commit 38f701e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions wrappers/dotnet/ZXingCpp/ZXingCpp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ public enum BarcodeFormats
LinearCodes = Codabar | Code39 | Code93 | Code128 | EAN8 | EAN13 | ITF | DataBar | DataBarExpanded | DXFilmEdge | UPCA | UPCE,
MatrixCodes = Aztec | DataMatrix | MaxiCode | PDF417 | QRCode | MicroQRCode | RMQRCode,
Any = LinearCodes | MatrixCodes,

Invalid = -1,
};


Expand Down Expand Up @@ -312,7 +310,7 @@ public class BarcodeReader : ReaderOptions
public static BarcodeFormats FormatsFromString(string str)
{
var fmts = zxing_BarcodeFormatsFromString(str);
if (fmts == BarcodeFormats.Invalid)
if ((int)fmts == -1) // see zxing_BarcodeFormat_Invalid
throw new Exception(MarshalAsString(zxing_LastErrorMsg()));
return fmts;
}
Expand Down

0 comments on commit 38f701e

Please sign in to comment.