#pragma once #include #include #include #include namespace nx { class FacHeader : public fnd::ISerialisable { public: struct sSection { size_t offset; size_t size; void operator=(const sSection& other) { offset = other.offset; size = other.size; } bool operator==(const sSection& other) const { return (offset == other.offset) \ && (size == other.size); } bool operator!=(const sSection& other) const { return !operator==(other); } }; FacHeader(); FacHeader(const FacHeader& other); void operator=(const FacHeader& other); bool operator==(const FacHeader& other) const; bool operator!=(const FacHeader& other) const; // export/import binary void toBytes(); void fromBytes(const byte_t* bytes, size_t len); const fnd::Vec& getBytes() const; // variables void clear(); size_t getFacSize() const; uint32_t getFormatVersion() const; void setFormatVersion(uint32_t version); const fnd::List& getFsaRightsList() const; void setFsaRightsList(const fnd::List& list); const sSection& getContentOwnerIdPos() const; void setContentOwnerIdPos(const sSection& pos); const sSection& getSaveDataOwnerIdPos() const;; void setSaveDataOwnerIdPos(const sSection& pos); private: const std::string kModuleName = "FAC_HEADER"; // raw binary fnd::Vec mRawBinary; // variables uint32_t mVersion; fnd::List mFsaRights; sSection mContentOwnerIdPos; sSection mSaveDataOwnerIdPos; }; }