diff --git a/.idea/.idea.DiscImageChef/.idea/contentModel.xml b/.idea/.idea.DiscImageChef/.idea/contentModel.xml index 65dba0460..2511b4455 100644 --- a/.idea/.idea.DiscImageChef/.idea/contentModel.xml +++ b/.idea/.idea.DiscImageChef/.idea/contentModel.xml @@ -1350,7 +1350,10 @@ - + + + + diff --git a/DiscImageChef.Filesystems/DiscImageChef.Filesystems.csproj b/DiscImageChef.Filesystems/DiscImageChef.Filesystems.csproj index 6cc354ec2..8f59ee266 100644 --- a/DiscImageChef.Filesystems/DiscImageChef.Filesystems.csproj +++ b/DiscImageChef.Filesystems/DiscImageChef.Filesystems.csproj @@ -79,6 +79,13 @@ + + + + + + + @@ -91,7 +98,6 @@ - diff --git a/DiscImageChef.Filesystems/Opera/Consts.cs b/DiscImageChef.Filesystems/Opera/Consts.cs new file mode 100644 index 000000000..e43dcce95 --- /dev/null +++ b/DiscImageChef.Filesystems/Opera/Consts.cs @@ -0,0 +1,4 @@ +namespace DiscImageChef.Filesystems +{ + public partial class OperaFS { } +} \ No newline at end of file diff --git a/DiscImageChef.Filesystems/Opera/Dir.cs b/DiscImageChef.Filesystems/Opera/Dir.cs new file mode 100644 index 000000000..9882a25fd --- /dev/null +++ b/DiscImageChef.Filesystems/Opera/Dir.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using DiscImageChef.CommonTypes.Structs; + +namespace DiscImageChef.Filesystems +{ + public partial class OperaFS + { + public Errno ReadDir(string path, out List contents) => throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/DiscImageChef.Filesystems/Opera/File.cs b/DiscImageChef.Filesystems/Opera/File.cs new file mode 100644 index 000000000..80930935f --- /dev/null +++ b/DiscImageChef.Filesystems/Opera/File.cs @@ -0,0 +1,16 @@ +using System; +using DiscImageChef.CommonTypes.Structs; + +namespace DiscImageChef.Filesystems +{ + public partial class OperaFS + { + public Errno MapBlock(string path, long fileBlock, out long deviceBlock) => throw new NotImplementedException(); + + public Errno GetAttributes(string path, out FileAttributes attributes) => throw new NotImplementedException(); + + public Errno Read(string path, long offset, long size, ref byte[] buf) => throw new NotImplementedException(); + + public Errno Stat(string path, out FileEntryInfo stat) => throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/DiscImageChef.Filesystems/Opera.cs b/DiscImageChef.Filesystems/Opera/Info.cs similarity index 54% rename from DiscImageChef.Filesystems/Opera.cs rename to DiscImageChef.Filesystems/Opera/Info.cs index 66840e2c0..6ad1b24c0 100644 --- a/DiscImageChef.Filesystems/Opera.cs +++ b/DiscImageChef.Filesystems/Opera/Info.cs @@ -1,53 +1,14 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : Opera.cs -// Author(s) : Natalia Portillo -// -// Component : Opera filesystem plugin. -// -// --[ Description ] ---------------------------------------------------------- -// -// Identifies the Opera filesystem and shows information. -// -// --[ License ] -------------------------------------------------------------- -// -// This library is free software; you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 2.1 of the -// License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, see . -// -// ---------------------------------------------------------------------------- -// Copyright © 2011-2019 Natalia Portillo -// ****************************************************************************/ - using System; -using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Interfaces; +using DiscImageChef.Helpers; using Schemas; -using Marshal = DiscImageChef.Helpers.Marshal; namespace DiscImageChef.Filesystems { - public class OperaFS : IFilesystem + public partial class OperaFS { - public FileSystemType XmlFsType { get; private set; } - public Encoding Encoding { get; private set; } - public string Name => "Opera Filesystem Plugin"; - public Guid Id => new Guid("0ec84ec7-eae6-4196-83fe-943b3fe46dbd"); - public string Author => "Natalia Portillo"; - public bool Identify(IMediaImage imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) return false; @@ -127,39 +88,5 @@ namespace DiscImageChef.Filesystems Clusters = (ulong)sb.block_count }; } - - [StructLayout(LayoutKind.Sequential, Pack = 1)] - struct OperaSuperBlock - { - /// 0x000, Record type, must be 1 - public readonly byte record_type; - /// 0x001, 5 bytes, "ZZZZZ" - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] - public byte[] sync_bytes; - /// 0x006, Record version, must be 1 - public readonly byte record_version; - /// 0x007, Volume flags - public readonly byte volume_flags; - /// 0x008, 32 bytes, volume comment - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - public readonly byte[] volume_comment; - /// 0x028, 32 bytes, volume label - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - public readonly byte[] volume_label; - /// 0x048, Volume ID - public readonly int volume_id; - /// 0x04C, Block size in bytes - public readonly int block_size; - /// 0x050, Blocks in volume - public readonly int block_count; - /// 0x054, Root directory ID - public readonly int root_dirid; - /// 0x058, Root directory blocks - public readonly int rootdir_blocks; - /// 0x05C, Root directory block size - public readonly int rootdir_bsize; - /// 0x060, Last root directory copy - public readonly int last_root_copy; - } } } \ No newline at end of file diff --git a/DiscImageChef.Filesystems/Opera/Opera.cs b/DiscImageChef.Filesystems/Opera/Opera.cs new file mode 100644 index 000000000..4147e5c77 --- /dev/null +++ b/DiscImageChef.Filesystems/Opera/Opera.cs @@ -0,0 +1,72 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Opera.cs +// Author(s) : Natalia Portillo +// +// Component : Opera filesystem plugin. +// +// --[ Description ] ---------------------------------------------------------- +// +// Identifies the Opera filesystem and shows information. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2019 Natalia Portillo +// ****************************************************************************/ + +using System; +using System.Collections.Generic; +using System.Text; +using DiscImageChef.CommonTypes.Interfaces; +using DiscImageChef.CommonTypes.Structs; +using Schemas; + +namespace DiscImageChef.Filesystems +{ + public partial class OperaFS : IReadOnlyFilesystem + { + public FileSystemType XmlFsType { get; private set; } + public Encoding Encoding { get; private set; } + public string Name => "Opera Filesystem Plugin"; + public Guid Id => new Guid("0ec84ec7-eae6-4196-83fe-943b3fe46dbd"); + public string Author => "Natalia Portillo"; + + public Errno ListXAttr(string path, out List xattrs) + { + xattrs = null; + return Errno.NotSupported; + } + + public Errno GetXattr(string path, string xattr, ref byte[] buf) => Errno.NotSupported; + + public Errno ReadLink(string path, out string dest) + { + dest = null; + return Errno.NotSupported; + } + + public IEnumerable<(string name, Type type, string description)> SupportedOptions => + new (string name, Type type, string description)[] { }; + + public Dictionary Namespaces => null; + + static Dictionary GetDefaultOptions() => + new Dictionary {{"debug", false.ToString()}}; + } +} \ No newline at end of file diff --git a/DiscImageChef.Filesystems/Opera/Structs.cs b/DiscImageChef.Filesystems/Opera/Structs.cs new file mode 100644 index 000000000..fdd76bc5c --- /dev/null +++ b/DiscImageChef.Filesystems/Opera/Structs.cs @@ -0,0 +1,41 @@ +using System.Runtime.InteropServices; + +namespace DiscImageChef.Filesystems +{ + public partial class OperaFS + { + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct OperaSuperBlock + { + /// 0x000, Record type, must be 1 + public readonly byte record_type; + /// 0x001, 5 bytes, "ZZZZZ" + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public byte[] sync_bytes; + /// 0x006, Record version, must be 1 + public readonly byte record_version; + /// 0x007, Volume flags + public readonly byte volume_flags; + /// 0x008, 32 bytes, volume comment + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public readonly byte[] volume_comment; + /// 0x028, 32 bytes, volume label + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public readonly byte[] volume_label; + /// 0x048, Volume ID + public readonly int volume_id; + /// 0x04C, Block size in bytes + public readonly int block_size; + /// 0x050, Blocks in volume + public readonly int block_count; + /// 0x054, Root directory ID + public readonly int root_dirid; + /// 0x058, Root directory blocks + public readonly int rootdir_blocks; + /// 0x05C, Root directory block size + public readonly int rootdir_bsize; + /// 0x060, Last root directory copy + public readonly int last_root_copy; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Filesystems/Opera/Super.cs b/DiscImageChef.Filesystems/Opera/Super.cs new file mode 100644 index 000000000..52f797d04 --- /dev/null +++ b/DiscImageChef.Filesystems/Opera/Super.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Text; +using DiscImageChef.CommonTypes; +using DiscImageChef.CommonTypes.Interfaces; +using DiscImageChef.CommonTypes.Structs; + +namespace DiscImageChef.Filesystems +{ + public partial class OperaFS + { + public Errno Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding, + Dictionary options, string @namespace) => + throw new NotImplementedException(); + + public Errno Unmount() => throw new NotImplementedException(); + + public Errno StatFs(out FileSystemInfo stat) => throw new NotImplementedException(); + } +} \ No newline at end of file