Browse Source

update iflytopcpp

master
zhaohe 3 years ago
parent
commit
566b453f43
  1. 5
      .vscode/c_cpp_properties.json
  2. 5
      .vscode/settings.json
  3. 2
      dep/iflytopcpp
  4. 25
      src/configs/config.hpp
  5. 6
      src/main.cpp

5
.vscode/c_cpp_properties.json

@ -2,6 +2,11 @@
"configurations": [ "configurations": [
{ {
"name": "Linux", "name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/",
"${workspaceFolder}/dep"
],
"compilerPath": "/usr/bin/g++", "compilerPath": "/usr/bin/g++",
"cStandard": "gnu11", "cStandard": "gnu11",
"cppStandard": "gnu++14", "cppStandard": "gnu++14",

5
.vscode/settings.json

@ -96,6 +96,9 @@
"__functional_base_03": "cpp", "__functional_base_03": "cpp",
"__hash_table": "cpp", "__hash_table": "cpp",
"__tree": "cpp", "__tree": "cpp",
"__tuple": "cpp"
"__tuple": "cpp",
"hash_map": "cpp",
"__bit_reference": "cpp",
"*.ipp": "cpp"
} }
} }

2
dep/iflytopcpp

@ -1 +1 @@
Subproject commit ac9441de375de8bb2d88c48a3eb896c58027875b
Subproject commit f0124f4fa73a7ee29bddd8275f69cbef1fdedaa9

25
src/configs/config.hpp

@ -0,0 +1,25 @@
#pragma once
#include <exception>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <mutex>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#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", {});

6
src/main.cpp

@ -1,6 +1,12 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
#include "configs/config.hpp"
using namespace iflytop;
using namespace core;
using namespace std;
int main() int main()
{ {
shared_ptr<Config> config;
spdlog::info("Welcome to spdlog!"); spdlog::info("Welcome to spdlog!");
spdlog::error("Some error message with arg: {}", 1); spdlog::error("Some error message with arg: {}", 1);

Loading…
Cancel
Save