26 lines
649 B
C++
26 lines
649 B
C++
#pragma once
|
|
|
|
#include <sstream>
|
|
#include <iomanip>
|
|
#include <numeric>
|
|
#include <algorithm>
|
|
#include <vector>
|
|
#include <filesystem>
|
|
|
|
namespace filepath
|
|
{
|
|
static std::tuple<std::filesystem::path, std::filesystem::file_status> getFileInfo(const std::filesystem::directory_entry& entry)
|
|
{
|
|
const auto file_status (std::filesystem::status(entry));
|
|
return {entry.path(), file_status};
|
|
}
|
|
|
|
static bool endsWith(const std::string& string, const std::string& ending)
|
|
{
|
|
if (ending.size() > string.size())
|
|
return false;
|
|
|
|
return std::equal(ending.rbegin(), ending.rend(), string.rbegin());
|
|
}
|
|
}
|