formatter.h
Go to the documentation of this file.
1 //
2 // Copyright(c) 2015 Gabi Melman.
3 // Distributed under the MIT License (http://opensource.org/licenses/MIT)
4 //
5 
6 #pragma once
7 
9 
10 #include <vector>
11 #include <string>
12 #include <memory>
13 
14 namespace spdlog
15 {
16 namespace details
17 {
18 class flag_formatter;
19 }
20 
21 class formatter
22 {
23 public:
24  virtual ~formatter() {}
25  virtual void format(details::log_msg& msg) = 0;
26 };
27 
28 class pattern_formatter SPDLOG_FINAL : public formatter
29 {
30 
31 public:
32  explicit pattern_formatter(const std::string& pattern, pattern_time_type pattern_time = pattern_time_type::local);
33  pattern_formatter(const pattern_formatter&) = delete;
34  pattern_formatter& operator=(const pattern_formatter&) = delete;
35  void format(details::log_msg& msg) override;
36 private:
39  std::vector<std::unique_ptr<details::flag_formatter>> _formatters;
40  std::tm get_time(details::log_msg& msg);
41  void handle_flag(char flag);
42  void compile_pattern(const std::string& pattern);
43 };
44 }
45 
47 
std::string format(CStringRef format_str, ArgList args)
Definition: format.h:3686
virtual ~formatter()
Definition: formatter.h:24
const std::string _pattern
Definition: formatter.h:37
const pattern_time_type _pattern_time
Definition: formatter.h:38
std::vector< std::unique_ptr< details::flag_formatter > > _formatters
Definition: formatter.h:39


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Tue Jan 19 2021 03:06:05