mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use raw strings.
This commit is contained in:
@@ -58,41 +58,43 @@ public class PluginRegisterGenerator : ISourceGenerator
|
||||
|
||||
StringBuilder sb = new();
|
||||
|
||||
sb.AppendLine(@"// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Register.g.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Registers all plugins in this assembly.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// ""Software""), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/");
|
||||
sb.AppendLine("""
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Register.g.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Registers all plugins in this assembly.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
""");
|
||||
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("using System;");
|
||||
|
||||
@@ -56,12 +56,16 @@ public sealed partial class Cdrdao
|
||||
const string REGEX_DISCTYPE = @"^\s*(?<type>(CD_DA|CD_ROM_XA|CD_ROM|CD_I))";
|
||||
const string REGEX_EMPHASIS = @"^\s*(?<no>NO)?\s*PRE_EMPHASIS";
|
||||
const string REGEX_FILE_AUDIO =
|
||||
@"^\s*(AUDIO)?FILE\s*""(?<filename>.+)""\s*(#(?<base_offset>\d+))?\s*((?<start>[\d]+:[\d]+:[\d]+)|(?<start_num>\d+))\s*(?<length>[\d]+:[\d]+:[\d]+)?";
|
||||
"""^\s*(AUDIO)?FILE\s*"(?<filename>.+)"\s*(#(?<base_offset>\d+))?\s*((?<start>[\d]+:[\d]+:[\d]+)|(?<start_num>\d+))\s*(?<length>[\d]+:[\d]+:[\d]+)?""";
|
||||
const string REGEX_FILE_DATA =
|
||||
@"^\s*DATAFILE\s*""(?<filename>.+)""\s*(#(?<base_offset>\d+))?\s*(?<length>[\d]+:[\d]+:[\d]+)?";
|
||||
"""^\s*DATAFILE\s*"(?<filename>.+)"\s*(#(?<base_offset>\d+))?\s*(?<length>[\d]+:[\d]+:[\d]+)?""";
|
||||
const string REGEX_INDEX = @"^\s*INDEX\s*(?<address>\d+:\d+:\d+)";
|
||||
const string REGEX_ISRC = @"^\s*ISRC\s*""(?<isrc>[A-Z0-9]{5,5}[0-9]{7,7})""";
|
||||
const string REGEX_MCN = @"^\s*CATALOG\s*""(?<catalog>[\x21-\x7F]{13,13})""";
|
||||
const string REGEX_ISRC = """
|
||||
^\s*ISRC\s*"(?<isrc>[A-Z0-9]{5,5}[0-9]{7,7})"
|
||||
""";
|
||||
const string REGEX_MCN = """
|
||||
^\s*CATALOG\s*"(?<catalog>[\x21-\x7F]{13,13})"
|
||||
""";
|
||||
const string REGEX_PREGAP = @"^\s*START\s*(?<address>\d+:\d+:\d+)?";
|
||||
const string REGEX_STEREO = @"^\s*(?<num>(TWO|FOUR))_CHANNEL_AUDIO";
|
||||
const string REGEX_TRACK =
|
||||
@@ -71,14 +75,30 @@ public sealed partial class Cdrdao
|
||||
const string REGEX_ZERO_PREGAP = @"^\s*PREGAP\s*(?<length>\d+:\d+:\d+)";
|
||||
|
||||
// CD-Text
|
||||
const string REGEX_ARRANGER = @"^\s*ARRANGER\s*""(?<arranger>.+)""";
|
||||
const string REGEX_COMPOSER = @"^\s*COMPOSER\s*""(?<composer>.+)""";
|
||||
const string REGEX_DISC_ID = @"^\s*DISC_ID\s*""(?<discid>.+)""";
|
||||
const string REGEX_MESSAGE = @"^\s*MESSAGE\s*""(?<message>.+)""";
|
||||
const string REGEX_PERFORMER = @"^\s*PERFORMER\s*""(?<performer>.+)""";
|
||||
const string REGEX_SONGWRITER = @"^\s*SONGWRITER\s*""(?<songwriter>.+)""";
|
||||
const string REGEX_TITLE = @"^\s*TITLE\s*""(?<title>.+)""";
|
||||
const string REGEX_UPC = @"^\s*UPC_EAN\s*""(?<catalog>[\d]{13,13})""";
|
||||
const string REGEX_ARRANGER = """
|
||||
^\s*ARRANGER\s*"(?<arranger>.+)"
|
||||
""";
|
||||
const string REGEX_COMPOSER = """
|
||||
^\s*COMPOSER\s*"(?<composer>.+)"
|
||||
""";
|
||||
const string REGEX_DISC_ID = """
|
||||
^\s*DISC_ID\s*"(?<discid>.+)"
|
||||
""";
|
||||
const string REGEX_MESSAGE = """
|
||||
^\s*MESSAGE\s*"(?<message>.+)"
|
||||
""";
|
||||
const string REGEX_PERFORMER = """
|
||||
^\s*PERFORMER\s*"(?<performer>.+)"
|
||||
""";
|
||||
const string REGEX_SONGWRITER = """
|
||||
^\s*SONGWRITER\s*"(?<songwriter>.+)"
|
||||
""";
|
||||
const string REGEX_TITLE = """
|
||||
^\s*TITLE\s*"(?<title>.+)"
|
||||
""";
|
||||
const string REGEX_UPC = """
|
||||
^\s*UPC_EAN\s*"(?<catalog>[\d]{13,13})"
|
||||
""";
|
||||
|
||||
// Unused
|
||||
const string REGEX_CD_TEXT = @"^\s*CD_TEXT\s*\{";
|
||||
|
||||
@@ -62,14 +62,14 @@ public sealed partial class VMware
|
||||
const string REGEX_CID = @"^\s*CID\s*=\s*(?<cid>[0123456789abcdef]{8})$";
|
||||
const string REGEX_CID_PARENT = @"^\s*parentCID\s*=\s*(?<cid>[0123456789abcdef]{8})$";
|
||||
const string REGEX_TYPE =
|
||||
@"^\s*createType\s*=\s*\""(?<type>custom|monolithicSparse|monolithicFlat|twoGbMaxExtentSparse|twoGbMaxExtentFlat|fullDevice|partitionedDevice|vmfs|vmfsPreallocated|vmfsEagerZeroedThick|vmfsThin|vmfsSparse|vmfsRDM|vmfsRawDeviceMap|vmfsRDMP|vmfsPassthroughRawDeviceMap|vmfsRaw|streamOptimized)\""$";
|
||||
"""^\s*createType\s*=\s*\"(?<type>custom|monolithicSparse|monolithicFlat|twoGbMaxExtentSparse|twoGbMaxExtentFlat|fullDevice|partitionedDevice|vmfs|vmfsPreallocated|vmfsEagerZeroedThick|vmfsThin|vmfsSparse|vmfsRDM|vmfsRawDeviceMap|vmfsRDMP|vmfsPassthroughRawDeviceMap|vmfsRaw|streamOptimized)\"$""";
|
||||
const string REGEX_EXTENT =
|
||||
@"^\s*(?<access>(RW|RDONLY|NOACCESS))\s+(?<sectors>\d+)\s+(?<type>(FLAT|SPARSE|ZERO|VMFS|VMFSSPARSE|VMFSRDM|VMFSRAW))\s+\""(?<filename>.+)\""(\s*(?<offset>\d+))?$";
|
||||
const string REGEX_DDB_TYPE = @"^\s*ddb\.adapterType\s*=\s*\""(?<type>ide|buslogic|lsilogic|legacyESX)\""$";
|
||||
const string REGEX_DDB_SECTORS = @"^\s*ddb\.geometry\.sectors\s*=\s*\""(?<sectors>\d+)\""$";
|
||||
const string REGEX_DDB_HEADS = @"^\s*ddb\.geometry\.heads\s*=\s*\""(?<heads>\d+)\""$";
|
||||
const string REGEX_DDB_CYLINDERS = @"^\s*ddb\.geometry\.cylinders\s*=\s*\""(?<cylinders>\d+)\""$";
|
||||
const string PARENT_REGEX = @"^\s*parentFileNameHint\s*=\s*\""(?<filename>.+)\""$";
|
||||
"""^\s*(?<access>(RW|RDONLY|NOACCESS))\s+(?<sectors>\d+)\s+(?<type>(FLAT|SPARSE|ZERO|VMFS|VMFSSPARSE|VMFSRDM|VMFSRAW))\s+\"(?<filename>.+)\"(\s*(?<offset>\d+))?$""";
|
||||
const string REGEX_DDB_TYPE = """^\s*ddb\.adapterType\s*=\s*\"(?<type>ide|buslogic|lsilogic|legacyESX)\"$""";
|
||||
const string REGEX_DDB_SECTORS = """^\s*ddb\.geometry\.sectors\s*=\s*\"(?<sectors>\d+)\"$""";
|
||||
const string REGEX_DDB_HEADS = """^\s*ddb\.geometry\.heads\s*=\s*\"(?<heads>\d+)\"$""";
|
||||
const string REGEX_DDB_CYLINDERS = """^\s*ddb\.geometry\.cylinders\s*=\s*\"(?<cylinders>\d+)\"$""";
|
||||
const string PARENT_REGEX = """^\s*parentFileNameHint\s*=\s*\"(?<filename>.+)\"$""";
|
||||
const uint FLAGS_VALID_NEW_LINE = 0x01;
|
||||
const uint FLAGS_USE_REDUNDANT_TABLE = 0x02;
|
||||
const uint FLAGS_ZERO_GRAIN_GTE = 0x04;
|
||||
|
||||
Reference in New Issue
Block a user