//
//  FilesystemUtils.hpp
//  eagle0_server
//
//  Created by Dan Crosby on 11/5/17.
//  Copyright © 2017 none. All rights reserved.
//

#ifndef FilesystemUtils_hpp
#define FilesystemUtils_hpp

#include <string>
#include <vector>

#include "byte_vector.hpp"

using std::string;
using std::vector;

class FilesystemUtils {
public:
    static void SetExecPath(const string& execPath);

    static void MakeDirectoryIfNecessary(const string& directoryPath);

    static auto FilesInDirectory(const string& directoryPath, const string& fileExtension = "")
            -> vector<string>;
    static auto FileExistsAtPath(const string& path) -> bool;
    static auto StaticShardokFilesDirectory() -> string;
    static auto StaticEagle0FilesDirectory() -> string;
    static auto MapFilesDirectory() -> string;
    static auto SaveFilesDirectory() -> string;
    static auto CacheFilesDirectory() -> string;
    static auto GameRequestsDirectory() -> string;
    static auto AtomicallySaveToPath(const string& path, const byte_vector& data) -> bool;
    static auto LoadFromPath(const string& path) -> byte_vector;
};

#endif /* FilesystemUtils_hpp */
