userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
file_info_with_data.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/fs/file_info_with_data.hpp
4
/// @brief data structures to store file info with load data
5
6
#
include
<
filesystem
>
7
#
include
<
memory
>
8
#
include
<
string
>
9
#
include
<
unordered_map
>
10
#
include
<
variant
>
11
12
USERVER_NAMESPACE_BEGIN
13
14
/// @brief filesystem support
15
namespace
fs {
16
17
/// @brief Struct file with load data
18
///
19
/// `data_or_path` holds either file contents (`std::string`) or a full path to the file
20
/// (`std::filesystem::path`) when the file is too large to cache in memory.
21
struct
FileInfoWithData
{
22
std::variant<std::string, std::filesystem::path> data_or_path;
23
std::string extension;
24
};
25
26
using
FileInfoWithDataConstPtr = std::shared_ptr<
const
FileInfoWithData
>;
27
using
FileInfoWithDataMap = std::unordered_map<std::string, FileInfoWithDataConstPtr>;
28
29
}
// namespace fs
30
31
USERVER_NAMESPACE_END
userver
fs
file_info_with_data.hpp
Generated on
for userver by
Doxygen
1.17.0