#pragma once

#include "platform_api/platform_policy.h"

#include <cstdint>
#include <string_view>

namespace pp::platform {

struct AssetFileLoadDecision {
    bool should_read_file = true;
    bool skipped_load_result = true;
    std::int64_t last_write_time = 0;
};

struct AssetFileTimestampProbe {
    bool file_exists = false;
    std::int64_t last_write_time = 0;
};

[[nodiscard]] AssetFileTimestampProbe probe_asset_file_timestamp(
    std::string_view absolute_path);

[[nodiscard]] AssetFileLoadDecision plan_asset_file_load_with_probe(
    PlatformFamily family,
    bool already_loaded,
    std::int64_t previous_last_write_time,
    AssetFileTimestampProbe probe) noexcept;

[[nodiscard]] AssetFileLoadDecision plan_asset_file_load_for_platform(
    PlatformFamily family,
    std::string_view absolute_path,
    bool already_loaded,
    std::int64_t previous_last_write_time);

[[nodiscard]] AssetFileLoadDecision plan_asset_file_load(
    std::string_view absolute_path,
    bool already_loaded,
    std::int64_t previous_last_write_time);

}
