mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-05-17 07:21:43 +00:00
test: add unit test for IPakCreator
This commit is contained in:
@@ -2,30 +2,31 @@
|
||||
|
||||
#include "ObjContainer/ObjContainerReferenceable.h"
|
||||
#include "ObjContainer/ObjContainerRepository.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Utils/ObjStream.h"
|
||||
#include "Zone/Zone.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <istream>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
class IPak final : public ObjContainerReferenceable
|
||||
class IIPak : public ObjContainerReferenceable
|
||||
{
|
||||
class Impl;
|
||||
Impl* m_impl;
|
||||
|
||||
public:
|
||||
typedef uint32_t Hash;
|
||||
static ObjContainerRepository<IIPak, Zone> Repository;
|
||||
typedef std::uint32_t Hash;
|
||||
|
||||
static ObjContainerRepository<IPak, Zone> Repository;
|
||||
IIPak() = default;
|
||||
virtual ~IIPak() = default;
|
||||
IIPak(const IIPak& other) = default;
|
||||
IIPak(IIPak&& other) noexcept = default;
|
||||
IIPak& operator=(const IIPak& other) = default;
|
||||
IIPak& operator=(IIPak&& other) noexcept = default;
|
||||
|
||||
IPak(std::string path, std::unique_ptr<std::istream> stream);
|
||||
~IPak() override;
|
||||
|
||||
std::string GetName() override;
|
||||
|
||||
bool Initialize();
|
||||
_NODISCARD std::unique_ptr<iobjstream> GetEntryStream(Hash nameHash, Hash dataHash) const;
|
||||
virtual bool Initialize() = 0;
|
||||
[[nodiscard]] virtual std::unique_ptr<iobjstream> GetEntryStream(Hash nameHash, Hash dataHash) const = 0;
|
||||
|
||||
static std::unique_ptr<IIPak> Create(std::string path, std::unique_ptr<std::istream> stream);
|
||||
static Hash HashString(const std::string& str);
|
||||
static Hash HashData(const void* data, size_t dataSize);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user