forked from IntelRealSense/librealsense
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fw-logs-formating-options.h
50 lines (40 loc) · 1.5 KB
/
fw-logs-formating-options.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* License: Apache 2.0. See LICENSE file in root directory. */
/* Copyright(c) 2019 Intel Corporation. All Rights Reserved. */
#pragma once
#include <unordered_map>
#include <string>
#include <stdint.h>
#include <vector>
#ifdef ANDROID
#include "../../common/android_helpers.h"
#endif
namespace fw_logger
{
struct fw_log_event
{
size_t num_of_params;
std::string line;
fw_log_event();
fw_log_event(int input_num_of_params, const std::string& input_line);
};
typedef std::pair<int,std::string> kvp; // XML key/value pair
class fw_logs_xml_helper;
class fw_logs_formating_options
{
public:
fw_logs_formating_options(const std::string& xml_full_file_path);
~fw_logs_formating_options(void);
bool get_event_data(int id, fw_log_event* log_event_data) const;
bool get_file_name(int id, std::string* file_name) const;
bool get_thread_name(uint32_t thread_id, std::string* thread_name) const;
std::unordered_map<std::string, std::vector<kvp>> get_enums() const;
bool initialize_from_xml();
private:
friend fw_logs_xml_helper;
std::unordered_map<int, fw_log_event> _fw_logs_event_list;
std::unordered_map<int, std::string> _fw_logs_file_names_list;
std::unordered_map<int, std::string> _fw_logs_thread_names_list;
std::unordered_map<std::string, std::vector<std::pair<int,std::string>>> _fw_logs_enum_names_list;
std::string _xml_full_file_path;
};
}