Skip to content

Commit 557bca9

Browse files
committed
Added WSJCppCore::removeFile
1 parent 6e01077 commit 557bca9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/wsjcpp_core.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,11 @@ bool WSJCppCore::writeFile(const std::string &sFilename, const char *pBuffer, co
353353
return true;
354354
}
355355

356+
// ---------------------------------------------------------------------
356357

358+
bool WSJCppCore::removeFile(const std::string &sFilename) {
359+
return remove(sFilename.c_str()) == 0;
360+
}
357361

358362
// ---------------------------------------------------------------------
359363

@@ -521,3 +525,4 @@ void WSJCppLog::add(WSJCppColorModifier &clr, const std::string &sType, const st
521525
logFile.close();
522526
}
523527

528+

src/wsjcpp_core.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class WSJCppCore {
3939
static bool writeFile(const std::string &sFilename, const std::string &sContent);
4040
static bool readTextFile(const std::string &sFilename, std::string &sOutputContent);
4141
static bool writeFile(const std::string &sFilename, const char *pBuffer, const int nBufferSize);
42-
42+
static bool removeFile(const std::string &sFilename);
4343

4444
static std::string& ltrim(std::string& str, const std::string& chars = "\t\n\v\f\r ");
4545
static std::string& rtrim(std::string& str, const std::string& chars = "\t\n\v\f\r ");
@@ -104,3 +104,4 @@ class WSJCppLog {
104104

105105
#endif // WSJCPP_CORE_H
106106

107+

0 commit comments

Comments
 (0)