#pragma once

#include <string>
#include <vector>
#include <memory>

namespace mosis {

/**
 * Platform-agnostic interface for loading assets.
 * Android implements this using AAssetManager.
 * Desktop implements this using filesystem operations.
 */
class IAssetInterface {
public:
    virtual ~IAssetInterface() = default;

    /**
     * Read entire file contents as bytes.
     * @param path Relative path to asset (e.g., "apps/home/home.rml")
     * @return File contents, or empty vector if not found
     */
    virtual std::vector<uint8_t> ReadFile(const std::string& path) = 0;

    /**
     * Read entire file contents as string.
     * @param path Relative path to asset
     * @return File contents, or empty string if not found
     */
    virtual std::string ReadFileString(const std::string& path) = 0;

    /**
     * Check if an asset exists.
     * @param path Relative path to asset
     * @return true if asset exists
     */
    virtual bool Exists(const std::string& path) = 0;

    /**
     * List files in a directory.
     * @param path Relative path to directory
     * @return List of filenames (not full paths)
     */
    virtual std::vector<std::string> ListDirectory(const std::string& path) = 0;

    /**
     * Get the absolute path for an asset (if applicable).
     * On Android this may return empty as assets are in APK.
     * @param path Relative path to asset
     * @return Absolute path or empty string
     */
    virtual std::string GetAbsolutePath(const std::string& path) = 0;
};

using AssetInterfacePtr = std::shared_ptr<IAssetInterface>;

} // namespace mosis
