Directory listing

This commit is contained in:
Dan Paulat 2022-11-02 21:59:16 -05:00
parent b9fc22d63e
commit d5d9285736
6 changed files with 337 additions and 0 deletions

View file

@ -0,0 +1,30 @@
#pragma once
#include <chrono>
#include <filesystem>
#include <string>
namespace scwx
{
namespace network
{
struct DirListRecord
{
std::string filename_ = {};
std::filesystem::file_type type_ = std::filesystem::file_type::unknown;
std::chrono::system_clock::time_point mtime_ =
{}; ///< Modified time (server time)
size_t size_ = 0u; ///< Approximate file size in bytes
};
/**
* @brief Retrieve Directory Listing
*
* Retrieves a directory listing. Supports default Apache-style directory
* listings only.
*/
std::vector<DirListRecord> DirList(const std::string& baseUrl);
} // namespace network
} // namespace scwx