From c72f5f64e6790bab96f328cbff2e533b3c04b0f9 Mon Sep 17 00:00:00 2001 From: daleclack Date: Tue, 10 Aug 2021 12:32:02 +0800 Subject: [PATCH] Add Config File Test --- cpp/cfgfile.cpp | 92 ++++++++++++++++++++++++++++ {tools => cpp}/m4s_to_mp4.cpp | 0 {tools => cpp}/type_format.cpp | 0 tools/csv_to_xls.py => csv_to_xls.py | 0 4 files changed, 92 insertions(+) create mode 100644 cpp/cfgfile.cpp rename {tools => cpp}/m4s_to_mp4.cpp (100%) rename {tools => cpp}/type_format.cpp (100%) rename tools/csv_to_xls.py => csv_to_xls.py (100%) diff --git a/cpp/cfgfile.cpp b/cpp/cfgfile.cpp new file mode 100644 index 0000000..b752a00 --- /dev/null +++ b/cpp/cfgfile.cpp @@ -0,0 +1,92 @@ +#include +#include +#include + +typedef void (*pfun)();//The Function Pointer + +static bool readCfgFile(const char * cfgfilePath,const std::string &key,std::string &value){ + //Open The Config File + std::fstream cfgfile; + cfgfile.open(cfgfilePath); + if(!cfgfile.is_open()){ + std::cout<<"Failed to open the file!"<