From 566b453f435ccabc72a90b1a7744765654769130 Mon Sep 17 00:00:00 2001 From: Zhaohe Date: Fri, 9 Dec 2022 20:12:44 +0800 Subject: [PATCH] update iflytopcpp --- .vscode/c_cpp_properties.json | 5 +++++ .vscode/settings.json | 5 ++++- dep/iflytopcpp | 2 +- src/configs/config.hpp | 25 +++++++++++++++++++++++++ src/main.cpp | 6 ++++++ 5 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 src/configs/config.hpp diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 9c7abbd..b690ade 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -2,6 +2,11 @@ "configurations": [ { "name": "Linux", + "includePath": [ + "${workspaceFolder}/**", + "${workspaceFolder}/", + "${workspaceFolder}/dep" + ], "compilerPath": "/usr/bin/g++", "cStandard": "gnu11", "cppStandard": "gnu++14", diff --git a/.vscode/settings.json b/.vscode/settings.json index 14eeae0..b7223bb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -96,6 +96,9 @@ "__functional_base_03": "cpp", "__hash_table": "cpp", "__tree": "cpp", - "__tuple": "cpp" + "__tuple": "cpp", + "hash_map": "cpp", + "__bit_reference": "cpp", + "*.ipp": "cpp" } } \ No newline at end of file diff --git a/dep/iflytopcpp b/dep/iflytopcpp index ac9441d..f0124f4 160000 --- a/dep/iflytopcpp +++ b/dep/iflytopcpp @@ -1 +1 @@ -Subproject commit ac9441de375de8bb2d88c48a3eb896c58027875b +Subproject commit f0124f4fa73a7ee29bddd8275f69cbef1fdedaa9 diff --git a/src/configs/config.hpp b/src/configs/config.hpp new file mode 100644 index 0000000..c7b3c51 --- /dev/null +++ b/src/configs/config.hpp @@ -0,0 +1,25 @@ + +#pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "iflytopcpp/core/components/config_template/config_template.hpp" + +#define ConfigELEMENT_LIST(marco) \ + /**/ \ + marco(string /* */, deviceId, "") /**/ \ + marco(size_t /* */, safe_disk_size_g, 50) /*当剩余磁盘空间小于该数值时停止同步*/ + +configTemplateDEFILE_CONFIG_SERVICE2( // + Config, // + ConfigELEMENT_LIST, // + "./configs/config.json", {}); diff --git a/src/main.cpp b/src/main.cpp index d32f1aa..ae46c51 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,12 @@ #include "spdlog/spdlog.h" +#include "configs/config.hpp" +using namespace iflytop; +using namespace core; +using namespace std; int main() { + + shared_ptr config; spdlog::info("Welcome to spdlog!"); spdlog::error("Some error message with arg: {}", 1);