29 lines
418 B
C++
29 lines
418 B
C++
// TJP COPYRIGHT HEADER
|
|
|
|
|
|
#ifdef TJP_CORE_HEADER_ONLY
|
|
#pragma once
|
|
#endif
|
|
|
|
#include <tjp/core/header_only/compile.h>
|
|
|
|
#include "copy.hpp"
|
|
#include "read.hpp"
|
|
#include "write.hpp"
|
|
|
|
#include <cstdio>
|
|
|
|
namespace tjp::core::file {
|
|
|
|
TJP_CORE_HEADER_ONLY_INLINE
|
|
bool copy(const String &from, const String &to)
|
|
{
|
|
if (auto contents = read(from))
|
|
if (write(to, *contents))
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
|
|
} // namespace
|