libeditwl
Lightweight C++ library for Nintendo DS(i) formats
Loading...
Searching...
No Matches
fmt_NARC.hpp
1
2#pragma once
3#include <twl/fmt/fmt_Common.hpp>
4#include <twl/fmt/nfs/nfs_NitroFs.hpp>
5
6namespace twl::fmt {
7
8 struct NARC : public fs::FileFormat, public nfs::NitroFileSystemFormat {
9
10 struct Header : public CommonHeader<0x4352414E /* "NARC" */ > {
11
12 static constexpr u16 SupportedByteOrder = 0xFFFE;
13 static constexpr u16 SupportedVersion = 0x100;
14 };
15
16 struct FileAllocationTableBlock : public CommonBlock<0x46415442 /* "BTAF" */ > {
17 u16 entry_count;
18 u8 reserved[2];
19 };
20
21 struct FileNameTableBlock : public CommonBlock<0x464E5442 /* "BTNF" */ > {
22 };
23
24 struct FileImageBlock : public CommonBlock<0x46494D47 /* "GMIF" */ > {
25 };
26
27 static constexpr size_t SectionAlignment = 0x4;
28
29 Header header;
32 FileImageBlock fimg;
33
34 NARC() {}
35 NARC(const NARC&) = delete;
36 NARC(NARC&&) = default;
37
38 Result ReadValidateFrom(fs::File &rf) override;
39 Result ReadAllFrom(fs::File &rf) override;
40 Result WriteTo(fs::File &wf) override;
41 };
42
43}
Definition nfs_NitroFs.hpp:100
Definition fs_FileFormat.hpp:7
Definition fs_File.hpp:232
Definition twl_Include.hpp:62
Definition fmt_Common.hpp:53
Definition fmt_Common.hpp:35
Definition fmt_NARC.hpp:24
Definition fmt_NARC.hpp:21
Definition fmt_NARC.hpp:10
Definition fmt_NARC.hpp:8