|
@@ -4,7 +4,12 @@
|
|
|
|
|
|
|
|
#pragma once
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
+#include <memory>
|
|
|
|
|
+
|
|
|
#include "common/common_types.h"
|
|
#include "common/common_types.h"
|
|
|
|
|
+#include "common/bit_field.h"
|
|
|
|
|
+
|
|
|
|
|
+#include "core/file_sys/file.h"
|
|
|
|
|
|
|
|
#include "core/hle/kernel/kernel.h"
|
|
#include "core/hle/kernel/kernel.h"
|
|
|
|
|
|
|
@@ -13,6 +18,13 @@
|
|
|
|
|
|
|
|
namespace FileSys {
|
|
namespace FileSys {
|
|
|
|
|
|
|
|
|
|
+union Mode {
|
|
|
|
|
+ u32 hex;
|
|
|
|
|
+ BitField<0, 1, u32> read_flag;
|
|
|
|
|
+ BitField<1, 1, u32> write_flag;
|
|
|
|
|
+ BitField<2, 1, u32> create_flag;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
class Archive : NonCopyable {
|
|
class Archive : NonCopyable {
|
|
|
public:
|
|
public:
|
|
|
/// Supported archive types
|
|
/// Supported archive types
|
|
@@ -35,6 +47,14 @@ public:
|
|
|
*/
|
|
*/
|
|
|
virtual IdCode GetIdCode() const = 0;
|
|
virtual IdCode GetIdCode() const = 0;
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Open a file specified by its path, using the specified mode
|
|
|
|
|
+ * @param path Path relative to the archive
|
|
|
|
|
+ * @param mode Mode to open the file with
|
|
|
|
|
+ * @return Opened file, or nullptr
|
|
|
|
|
+ */
|
|
|
|
|
+ virtual std::unique_ptr<File> OpenFile(const std::string& path, const Mode mode) const = 0;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Read data from the archive
|
|
* Read data from the archive
|
|
|
* @param offset Offset in bytes to start reading data from
|
|
* @param offset Offset in bytes to start reading data from
|