#pragma once

#include <MSFS/Legacy/gauges.h>

#include "rapidjson/document.h"

namespace khofmann
{
	/// <summary>
	/// Read a file and return file contents
	/// </summary>
	/// <param name="path">Path of BASE64 encoded File</param>
	/// <param name="alloc">Allocator</param>
	/// <returns>File contents</returns>
	rapidjson::Value readFile(const char* path, rapidjson::Document::AllocatorType& alloc);

	/// <summary>
	/// Write a file to disk
	/// </summary>
	/// <param name="path">Path to file</param>
	/// <param name="contents">Contents of file</param>
	/// <param name="length">Length of contents</param>
	void writeFile(const char* path, rapidjson::Value& contents);

	/// <summary>
	/// Enumerate a directory and return list of directories.
	/// Return tumbnail as BASE64 and page count if present.
	/// </summary>
	/// <param name="path">Path of directory</param>
	/// <param name="files">Pointer to files value object</param>
	/// <param name="alloc">Allocator</param>
	void enumerateDir(const char* path, rapidjson::Value& files, rapidjson::Document::AllocatorType& alloc);
}