[Aaru.Decoders] Introduced constants for module names

Introduces constant fields for respective debug module names, replacing the hardcoded ones.
This is done to standardize the naming convention, reduce redundancy and potentially avoid any typos or name mismatches across the project.
This change makes the code more maintainable and easier to update in case module names need to be changed.
This commit is contained in:
2023-10-03 17:21:19 +01:00
parent 3d72f0d7da
commit 2a52c3075d
15 changed files with 98 additions and 74 deletions

View File

@@ -60,6 +60,8 @@ namespace Aaru.Decoders.CD;
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class FullTOC
{
const string MODULE_NAME = "CD full TOC decoder";
public static CDFullTOC? Decode(byte[] CDFullTOCResponse)
{
if(CDFullTOCResponse is not { Length: > 4 })
@@ -76,7 +78,7 @@ public static class FullTOC
if(decoded.DataLength + 2 != CDFullTOCResponse.Length)
{
AaruConsole.DebugWriteLine("CD full TOC decoder",
AaruConsole.DebugWriteLine(MODULE_NAME,
Localization.
Expected_CDFullTOC_size_0_bytes_is_not_received_size_1_bytes_not_decoding,
decoded.DataLength + 2, CDFullTOCResponse.Length);