- forgotten fixes from March
This commit is contained in:
parent
762eb9ca33
commit
0d69c26a13
|
|
@ -1,6 +1,7 @@
|
|||
#include "HL_CrashRpt.h"
|
||||
|
||||
#if defined(USE_CRASHRPT)
|
||||
|
||||
#include "HL_CrashRpt.h"
|
||||
#include "HL_String.h"
|
||||
|
||||
|
||||
|
|
@ -171,4 +172,22 @@ CrashReporterGuard::~CrashReporterGuard()
|
|||
CrashReporter::free();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
CrashReporterThreadPoint::CrashReporterThreadPoint()
|
||||
{
|
||||
}
|
||||
|
||||
CrashReporterThreadPoint::~CrashReporterThreadPoint()
|
||||
{
|
||||
}
|
||||
|
||||
CrashReporterGuard::CrashReporterGuard()
|
||||
{
|
||||
}
|
||||
|
||||
CrashReporterGuard::~CrashReporterGuard()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@ bool CsvReader::readLine(std::vector<std::string>& cells)
|
|||
std::string line;
|
||||
if (!std::getline(mInputStream, line))
|
||||
return false;
|
||||
StringHelper::trim(line);
|
||||
if (line.empty())
|
||||
return false;
|
||||
|
||||
StringHelper::split(line, cells, ",;");
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -202,7 +202,6 @@ std::shared_ptr<std::thread> OsProcess::asyncExecCommand(const std::string& cmdl
|
|||
std::string OsProcess::execCommand(const std::string& cmd)
|
||||
{
|
||||
std::string cp = cmd;
|
||||
|
||||
std::shared_ptr<FILE> pipe(popen(cp.c_str(), "r"), pclose);
|
||||
if (!pipe)
|
||||
throw std::runtime_error("Failed to run.");
|
||||
|
|
|
|||
|
|
@ -276,8 +276,8 @@ float StringHelper::toFloat(const std::string &s, float v, bool* isOk)
|
|||
|
||||
std::string StringHelper::trim(const std::string &s)
|
||||
{
|
||||
auto wsfront = std::find_if_not(s.begin(), s.end(), [](int c) { return std::isspace(c); });
|
||||
auto wsback = std::find_if_not(s.rbegin(), s.rend(), [](int c) { return std::isspace(c); }).base();
|
||||
auto wsfront = std::find_if_not(s.begin(), s.end(), [](int c) { return std::isspace(c) || c == '\r' || c == '\n'; });
|
||||
auto wsback = std::find_if_not(s.rbegin(), s.rend(), [](int c) { return std::isspace(c) || c == '\r' || c == '\n'; }).base();
|
||||
return (wsback <= wsfront ? std::string() : std::string(wsfront,wsback));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue