OGLplus  (0.59.0) a C++ wrapper for rendering APIs

filesystem.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_LOGGING_TYPE_FILESYSTEM_HPP
10 #define EAGINE_LOGGING_TYPE_FILESYSTEM_HPP
11 
12 #include "../entry.hpp"
13 #include <filesystem>
14 
15 namespace eagine {
16 //------------------------------------------------------------------------------
17 static inline auto
18 adapt_log_entry_arg(identifier name, const std::filesystem::path& fsp) {
19  return [name, fsps{fsp.native()}](logger_backend& backend) {
20  backend.add_string(name, EAGINE_ID(FsPath), string_view(fsps));
21  };
22 }
23 //------------------------------------------------------------------------------
24 static inline auto adapt_log_entry_arg(
25  identifier name,
26  const std::filesystem::filesystem_error& value) {
27  return [name, value](logger_backend& backend) {
28  backend.add_string(
29  name, EAGINE_ID(FlSysError), string_view(value.what()));
30  backend.add_string(
31  EAGINE_ID(category),
32  EAGINE_ID(ErrorCtgry),
33  string_view(value.code().category().name()));
34  };
35 }
36 //------------------------------------------------------------------------------
37 } // namespace eagine
38 
39 #endif // EAGINE_LOGGING_TYPE_FILESYSTEM_HPP
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116
#define EAGINE_ID(NAME)
Macro for constructing instances of eagine::identifier.
Definition: identifier.hpp:353
Common code is placed in this namespace.
Definition: eagine.hpp:21
basic_identifier< 10, 6, default_identifier_char_set, identifier_t > identifier
Default identifier type used throughout the project.
Definition: identifier.hpp:346

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).