32 lines
620 B
C++
32 lines
620 B
C++
// TJP COPYRIGHT HEADER
|
|
|
|
#ifdef TJP_CORE_HEADER_ONLY
|
|
#pragma once
|
|
#endif
|
|
#include <tjp/core/header_only/compile.h>
|
|
|
|
#include "VirtualFileSystem.hpp"
|
|
|
|
namespace tjp::core::file {
|
|
|
|
TJP_CORE_HEADER_ONLY_INLINE
|
|
Contents readFile(const VirtualFileSystem &system, const StringView &path)
|
|
{
|
|
return system.get(path);
|
|
}
|
|
|
|
TJP_CORE_HEADER_ONLY_INLINE
|
|
void writeFile(VirtualFileSystem &system, const StringView &path, ContentsView contents)
|
|
{
|
|
return system.put(path, contents);
|
|
}
|
|
|
|
TJP_CORE_HEADER_ONLY_INLINE
|
|
bool fileExists(const VirtualFileSystem &system, const StringView &path)
|
|
{
|
|
return system.has(path);
|
|
}
|
|
|
|
|
|
} // namespace
|