summaryrefslogtreecommitdiff
path: root/src/shared/fileregisterfwd.h
diff options
context:
space:
mode:
authorAL <26797547+Al12rs@users.noreply.github.com>2020-10-31 20:58:07 +0100
committerAL <26797547+Al12rs@users.noreply.github.com>2020-11-02 20:35:05 +0100
commitb7935aedec70dd4f0c40dbe948dba9a80a56a75a (patch)
tree358266669f9163a883dcc4fabf3fcc67f8b80fa0 /src/shared/fileregisterfwd.h
parent88475677d29a275fd9d25f452f58d3d745720124 (diff)
Change Alternatives vector to use a struct
Diffstat (limited to 'src/shared/fileregisterfwd.h')
-rw-r--r--src/shared/fileregisterfwd.h33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/shared/fileregisterfwd.h b/src/shared/fileregisterfwd.h
index 720e6e30..a3cf8132 100644
--- a/src/shared/fileregisterfwd.h
+++ b/src/shared/fileregisterfwd.h
@@ -42,15 +42,36 @@ using OriginID = int;
constexpr FileIndex InvalidFileIndex = UINT_MAX;
constexpr OriginID InvalidOriginID = -1;
-
-// a vector of {originId, {archiveName, order}}
-//
-// if a file is in an archive, archiveName is the name of the bsa and order
+// if a file is in an archive, name is the name of the bsa and order
// is the order of the associated plugin in the plugins list
-//
// is a file is not in an archive, archiveName is empty and order is usually
// -1
-using AlternativesVector = std::vector<std::pair<OriginID, std::pair<std::wstring, int>>>;
+struct DataArchiveOrigin
+{
+ std::wstring name = L"";
+ int order = -1;
+
+ bool isValid() const {
+ return name.size() > 0;
+ }
+
+ DataArchiveOrigin(std::wstring pname, int porder)
+ : name(pname), order(porder) {}
+
+ DataArchiveOrigin() {}
+};
+
+struct FileAlternative
+{
+ OriginID originID = -1;
+ DataArchiveOrigin archive;
+
+ bool isFromArchive() const {
+ return archive.isValid();
+ }
+};
+
+using AlternativesVector = std::vector<FileAlternative>;
struct DirectoryStats
{