From 08fcd825a71fbd06f0af8f66592d15fd0d3713b7 Mon Sep 17 00:00:00 2001 From: daleclack Date: Sat, 6 May 2023 14:27:41 +0800 Subject: [PATCH] Remove unused libraries --- cfgfile2/cfgfile.cc | 70 --------------------------------------------- cfgfile2/cfgfile.hh | 7 ----- 2 files changed, 77 deletions(-) delete mode 100644 cfgfile2/cfgfile.cc delete mode 100644 cfgfile2/cfgfile.hh diff --git a/cfgfile2/cfgfile.cc b/cfgfile2/cfgfile.cc deleted file mode 100644 index 49fcb68..0000000 --- a/cfgfile2/cfgfile.cc +++ /dev/null @@ -1,70 +0,0 @@ -// A Test to read Config files -// This is a modified version -// The Config File Should be a text file -// and the content as follows -// key=value - -#include "cfgfile.hh" - -static void Trim(std::string &str){ - if(str.empty()){//String is empty - return; - } - - size_t i,start_pos,end_pos; - - for(i=0;i=0;i--){//Get End Position - if(!isspace(str[i])){ - break; - } - } - - end_pos=i; - - str=str.substr(start_pos,end_pos+1); -} - -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!"<