@@ -85,7 +85,8 @@ namespace BfxAPI
8585 wireParamsMissing, // 7
8686 addressParamsMissing, // 8
8787 badOrderType, // 9
88- jsonStrToUSetError // 10
88+ jsonStrToUSetError, // 10
89+ badWDconfFilePath // 11
8990 };
9091
9192 // //////////////////////////////////////////////////////////////////////
@@ -194,11 +195,19 @@ namespace BfxAPI
194195 // //////////////////////////////////////////////////////////////////////
195196
196197 // Getters
197- const string getWDconfFilePath () const { return WDconfFilePath_; }
198- const bfxERR& getBfxApiStatusCode () const { return bfxApiStatusCode_; }
199- const CURLcode& getCurlStatusCode () const { return curlStatusCode_; }
200- const string& strResponse () const { return result_ ; }
201- bool hasApiError () const
198+ const string getWDconfFilePath () const noexcept
199+ { return WDconfFilePath_; }
200+
201+ const bfxERR& getBfxApiStatusCode () const noexcept
202+ { return bfxApiStatusCode_; }
203+
204+ const CURLcode& getCurlStatusCode () const noexcept
205+ { return curlStatusCode_; }
206+
207+ const string& strResponse () const noexcept
208+ { return result_ ; }
209+
210+ bool hasApiError () const noexcept
202211 {
203212 if (bfxApiStatusCode_ == noError && curlStatusCode_ == CURLE_OK)
204213 return false ;
@@ -207,8 +216,9 @@ namespace BfxAPI
207216 }
208217
209218 // Setters
210- void setWDconfFilePath (const string &path) { WDconfFilePath_ = path; }
211- void setKeys (const string &accessKey, const string &secretKey)
219+ void setWDconfFilePath (const string &path) noexcept
220+ { WDconfFilePath_ = path; }
221+ void setKeys (const string &accessKey, const string &secretKey) noexcept
212222 {
213223 accessKey_ = accessKey;
214224 secretKey_ = secretKey;
@@ -923,9 +933,12 @@ namespace BfxAPI
923933 using std::smatch;
924934
925935 string line;
926- ifstream inFile;
927936 map<string, string> mParams ;
928- inFile.open (WDconfFilePath_);
937+ ifstream inFile (WDconfFilePath_, ifstream::in);
938+ if (!inFile.is_open ())
939+ {
940+ return badWDconfFilePath;
941+ }
929942 regex rgx (" ^(.*)\\ b\\ s*=\\ s*(\" {0,1}.*\" {0,1})$" );
930943 smatch match;
931944
@@ -1060,10 +1073,10 @@ namespace BfxAPI
10601073 // Utility private static methods
10611074 // //////////////////////////////////////////////////////////////////////
10621075
1063- static string bool2string (const bool &in)
1076+ static string bool2string (const bool &in) noexcept
10641077 { return in ? " true" : " false" ; };
10651078
1066- static string getTonce ()
1079+ static string getTonce () noexcept
10671080 {
10681081 using namespace std ::chrono;
10691082
@@ -1127,14 +1140,14 @@ namespace BfxAPI
11271140 static size_t WriteCallback (void *response,
11281141 size_t size,
11291142 size_t nmemb,
1130- void *userp)
1143+ void *userp) noexcept
11311144 {
11321145 (static_cast <string*>(userp))->append (static_cast <char *>(response));
11331146 return size * nmemb;
11341147 };
11351148
11361149 static bool inArray (const string &value,
1137- const unordered_set<string> &inputSet)
1150+ const unordered_set<string> &inputSet) noexcept
11381151 { return (inputSet.find (value) != inputSet.cend ()) ? true : false ; };
11391152 };
11401153}
0 commit comments