Use file-scoped namespaces.

This commit is contained in:
2021-11-09 19:34:17 +00:00
parent 327c013497
commit f351cbcf14
8 changed files with 1435 additions and 1443 deletions

View File

@@ -29,10 +29,10 @@ using System.IO;
using System.Linq;
using System.Text;
namespace Claunia.RsrcFork.CLI
namespace Claunia.RsrcFork.CLI;
class MainClass
{
class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine("Claunia.RsrcFork.CLI");
@@ -147,5 +147,4 @@ namespace Claunia.RsrcFork.CLI
Console.WriteLine("\t\tor");
Console.WriteLine("\tClaunia.RsrcFork.CLI.EXE -x -o output.dir resourcefork.bin - Extracts all resources to output.dir");
}
}
}

View File

@@ -28,11 +28,11 @@ using System.IO;
using NUnit.Framework;
using Resources;
namespace Claunia.RsrcFork.Test
namespace Claunia.RsrcFork.Test;
[TestFixture]
public class Test
{
[TestFixture]
public class Test
{
readonly byte[] DC42_Vers =
{
0x06, 0x40, 0x80, 0x00, 0x00, 0x00, 0x09, 0x44, 0x69, 0x73, 0x6B, 0x20, 0x43, 0x6F, 0x70, 0x79, 0x1C,
@@ -227,5 +227,4 @@ namespace Claunia.RsrcFork.Test
Resource vers = rsrc.GetResource(0x76657273);
Assert.IsNull(vers);
}
}
}

View File

@@ -27,13 +27,13 @@
using System;
using System.Text;
namespace Claunia.RsrcFork
namespace Claunia.RsrcFork;
/// <summary>
/// Contains convertes between .NET and Pascal strings. Only ASCII supported right now.
/// </summary>
public static class PascalString
{
/// <summary>
/// Contains convertes between .NET and Pascal strings. Only ASCII supported right now.
/// </summary>
public static class PascalString
{
/// <summary>
/// Converts an ASCII Pascal string to a .NET string.
/// </summary>
@@ -66,5 +66,4 @@ namespace Claunia.RsrcFork
return PStr;
}
}
}

View File

@@ -30,13 +30,13 @@ using System.IO;
using System.Linq;
using System.Text;
namespace Claunia.RsrcFork
namespace Claunia.RsrcFork;
/// <summary>
/// This class represents a resource type.
/// </summary>
public class Resource
{
/// <summary>
/// This class represents a resource type.
/// </summary>
public class Resource
{
readonly List<short> ids;
readonly Dictionary<short, byte[]> resourceCache;
readonly Dictionary<short, string> resourceNames;
@@ -177,5 +177,4 @@ namespace Claunia.RsrcFork
public long offset;
public long length;
}
}
}

View File

@@ -28,13 +28,13 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Claunia.RsrcFork
namespace Claunia.RsrcFork;
/// <summary>
/// This class represents a resource fork.
/// </summary>
public class ResourceFork
{
/// <summary>
/// This class represents a resource fork.
/// </summary>
public class ResourceFork
{
ResourceHeader header;
ResourceMap map;
List<uint> osTypes;
@@ -187,5 +187,4 @@ namespace Claunia.RsrcFork
/// </summary>
/// <param name="OSType">OSType.</param>
public bool ContainsKey(uint OSType) => resourceTypeList.ContainsKey(OSType);
}
}

View File

@@ -28,13 +28,13 @@ using System;
using System.Linq;
using Claunia.RsrcFork;
namespace Resources
namespace Resources;
/// <summary>
/// This class handles the "VERS" resource fork
/// </summary>
public class Version
{
/// <summary>
/// This class handles the "VERS" resource fork
/// </summary>
public class Version
{
/// <summary>
/// Known development stages
/// </summary>
@@ -151,5 +151,4 @@ namespace Resources
/// </summary>
public string VersionMessage;
#endregion
}
}

View File

@@ -24,10 +24,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
namespace Claunia.RsrcFork
namespace Claunia.RsrcFork;
struct ResourceHeader
{
struct ResourceHeader
{
/// <summary>
/// Offset from start of resource fork to resource data
/// </summary>
@@ -44,10 +44,10 @@ namespace Claunia.RsrcFork
/// Length of resource map
/// </summary>
public int resourceMapLen;
}
}
struct ResourceMap
{
struct ResourceMap
{
/// <summary>
/// Copy of the resource fork header
/// </summary>
@@ -76,10 +76,10 @@ namespace Claunia.RsrcFork
/// Number of types in the map minus 1
/// </summary>
public ushort numberOfTypes;
}
}
struct ResourceTypeListItem
{
struct ResourceTypeListItem
{
/// <summary>
/// Resource type
/// </summary>
@@ -92,10 +92,10 @@ namespace Claunia.RsrcFork
/// Offset from beginning of resource type list to reference list
/// </summary>
public short referenceOff;
}
}
struct ResourceTypeReferenceListItem
{
struct ResourceTypeReferenceListItem
{
/// <summary>
/// Resource ID
/// </summary>
@@ -116,5 +116,4 @@ namespace Claunia.RsrcFork
/// Reserved for handle to resource
/// </summary>
public uint handle;
}
}

View File

@@ -28,13 +28,13 @@ using System;
using System.Linq;
using System.Text;
namespace Claunia.RsrcFork
namespace Claunia.RsrcFork;
/// <summary>
/// This class contains static methods for OSTYPE handling.
/// </summary>
public static class Types
{
/// <summary>
/// This class contains static methods for OSTYPE handling.
/// </summary>
public static class Types
{
/// <summary>
/// Gets a descriptive name of a resource from its OSTYPE.
/// </summary>
@@ -702,5 +702,4 @@ namespace Claunia.RsrcFork
return GetName(type);
}
}
}