mirror of
https://github.com/claunia/Claunia.RsrcFork.git
synced 2025-12-16 19:24:46 +00:00
Use file-scoped namespaces.
This commit is contained in:
@@ -29,10 +29,10 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Claunia.RsrcFork.CLI
|
namespace Claunia.RsrcFork.CLI;
|
||||||
|
|
||||||
|
class MainClass
|
||||||
{
|
{
|
||||||
class MainClass
|
|
||||||
{
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Claunia.RsrcFork.CLI");
|
Console.WriteLine("Claunia.RsrcFork.CLI");
|
||||||
@@ -147,5 +147,4 @@ namespace Claunia.RsrcFork.CLI
|
|||||||
Console.WriteLine("\t\tor");
|
Console.WriteLine("\t\tor");
|
||||||
Console.WriteLine("\tClaunia.RsrcFork.CLI.EXE -x -o output.dir resourcefork.bin - Extracts all resources to output.dir");
|
Console.WriteLine("\tClaunia.RsrcFork.CLI.EXE -x -o output.dir resourcefork.bin - Extracts all resources to output.dir");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -28,11 +28,11 @@ using System.IO;
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using Resources;
|
using Resources;
|
||||||
|
|
||||||
namespace Claunia.RsrcFork.Test
|
namespace Claunia.RsrcFork.Test;
|
||||||
|
|
||||||
|
[TestFixture]
|
||||||
|
public class Test
|
||||||
{
|
{
|
||||||
[TestFixture]
|
|
||||||
public class Test
|
|
||||||
{
|
|
||||||
readonly byte[] DC42_Vers =
|
readonly byte[] DC42_Vers =
|
||||||
{
|
{
|
||||||
0x06, 0x40, 0x80, 0x00, 0x00, 0x00, 0x09, 0x44, 0x69, 0x73, 0x6B, 0x20, 0x43, 0x6F, 0x70, 0x79, 0x1C,
|
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);
|
Resource vers = rsrc.GetResource(0x76657273);
|
||||||
Assert.IsNull(vers);
|
Assert.IsNull(vers);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -27,13 +27,13 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Text;
|
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>
|
/// <summary>
|
||||||
/// Converts an ASCII Pascal string to a .NET string.
|
/// Converts an ASCII Pascal string to a .NET string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -66,5 +66,4 @@ namespace Claunia.RsrcFork
|
|||||||
|
|
||||||
return PStr;
|
return PStr;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -30,13 +30,13 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
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 List<short> ids;
|
||||||
readonly Dictionary<short, byte[]> resourceCache;
|
readonly Dictionary<short, byte[]> resourceCache;
|
||||||
readonly Dictionary<short, string> resourceNames;
|
readonly Dictionary<short, string> resourceNames;
|
||||||
@@ -177,5 +177,4 @@ namespace Claunia.RsrcFork
|
|||||||
public long offset;
|
public long offset;
|
||||||
public long length;
|
public long length;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -28,13 +28,13 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
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;
|
ResourceHeader header;
|
||||||
ResourceMap map;
|
ResourceMap map;
|
||||||
List<uint> osTypes;
|
List<uint> osTypes;
|
||||||
@@ -187,5 +187,4 @@ namespace Claunia.RsrcFork
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="OSType">OSType.</param>
|
/// <param name="OSType">OSType.</param>
|
||||||
public bool ContainsKey(uint OSType) => resourceTypeList.ContainsKey(OSType);
|
public bool ContainsKey(uint OSType) => resourceTypeList.ContainsKey(OSType);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -28,13 +28,13 @@ using System;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Claunia.RsrcFork;
|
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>
|
/// <summary>
|
||||||
/// Known development stages
|
/// Known development stages
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -151,5 +151,4 @@ namespace Resources
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string VersionMessage;
|
public string VersionMessage;
|
||||||
#endregion
|
#endregion
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,10 +24,10 @@
|
|||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
// THE SOFTWARE.
|
// THE SOFTWARE.
|
||||||
|
|
||||||
namespace Claunia.RsrcFork
|
namespace Claunia.RsrcFork;
|
||||||
|
|
||||||
|
struct ResourceHeader
|
||||||
{
|
{
|
||||||
struct ResourceHeader
|
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Offset from start of resource fork to resource data
|
/// Offset from start of resource fork to resource data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -44,10 +44,10 @@ namespace Claunia.RsrcFork
|
|||||||
/// Length of resource map
|
/// Length of resource map
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int resourceMapLen;
|
public int resourceMapLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ResourceMap
|
struct ResourceMap
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Copy of the resource fork header
|
/// Copy of the resource fork header
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -76,10 +76,10 @@ namespace Claunia.RsrcFork
|
|||||||
/// Number of types in the map minus 1
|
/// Number of types in the map minus 1
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ushort numberOfTypes;
|
public ushort numberOfTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ResourceTypeListItem
|
struct ResourceTypeListItem
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resource type
|
/// Resource type
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -92,10 +92,10 @@ namespace Claunia.RsrcFork
|
|||||||
/// Offset from beginning of resource type list to reference list
|
/// Offset from beginning of resource type list to reference list
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public short referenceOff;
|
public short referenceOff;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ResourceTypeReferenceListItem
|
struct ResourceTypeReferenceListItem
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resource ID
|
/// Resource ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -116,5 +116,4 @@ namespace Claunia.RsrcFork
|
|||||||
/// Reserved for handle to resource
|
/// Reserved for handle to resource
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public uint handle;
|
public uint handle;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -28,13 +28,13 @@ using System;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
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>
|
/// <summary>
|
||||||
/// Gets a descriptive name of a resource from its OSTYPE.
|
/// Gets a descriptive name of a resource from its OSTYPE.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -702,5 +702,4 @@ namespace Claunia.RsrcFork
|
|||||||
|
|
||||||
return GetName(type);
|
return GetName(type);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user