#ifndef KRIMI_DINNER_ENGINE_WIN32_ASSET_MANAGER_H
#define KRIMI_DINNER_ENGINE_WIN32_ASSET_MANAGER_H

#include "AssetManager.h"

class Win32AssetManager : public AssetManager
{
public:
    /// @brief Create the singleton instance
    ///
    /// Sets @ref AssetManager::ptr to the singleton instance
    /// @param asset_root_dir Directory where asset files are located
    static void create(const char* asset_root_dir);

    bool loadFile(const char* path, FileBuffer* p_file_buffer) override;

    void releaseFileBuffer(FileBuffer& fb) override;

    /// @brief Write data to a file.
    /// @param path Path relative to the asset root directory
    /// @param data Data buffer
    /// @param size Number of bytes
    /// @return @c true if writing the file was successfull, @c false otherwise
    bool writeFile(const char* path, const void* data, size_t size);

    /// @brief Write data to a file.
    /// @param path Path relative to the asset root directory
    /// @param file_buffer Data buffer
    /// @return @c true if writing the file was successfull, @c false otherwise
    bool writeFile(const char* path, const FileBuffer& file_buffer);

private:
    const char* m_asset_root;
};

#endif
