| File src/GcovImporter.cpp changed (mode: 100644) (index d277cce..4d70ad0) |
| 35 |
35 |
|
|
| 36 |
36 |
namespace fs = boost::filesystem; |
namespace fs = boost::filesystem; |
| 37 |
37 |
|
|
| 38 |
|
std::function<GcovImporter::runner_f> GcovImporter::runner; |
|
| 39 |
|
|
|
| 40 |
38 |
void |
void |
| 41 |
39 |
GcovImporter::setRunner(std::function<runner_f> runner) |
GcovImporter::setRunner(std::function<runner_f> runner) |
| 42 |
40 |
{ |
{ |
| 43 |
|
GcovImporter::runner = std::move(runner); |
|
|
41 |
|
getRunner() = std::move(runner); |
| 44 |
42 |
} |
} |
| 45 |
43 |
|
|
| 46 |
44 |
GcovImporter::GcovImporter(const std::string &root, |
GcovImporter::GcovImporter(const std::string &root, |
| |
| ... |
... |
GcovImporter::GcovImporter(const std::string &root, |
| 88 |
86 |
|
|
| 89 |
87 |
TempDir tempDir("gcovi"); |
TempDir tempDir("gcovi"); |
| 90 |
88 |
std::string tempDirPath = tempDir; |
std::string tempDirPath = tempDir; |
| 91 |
|
runner(std::move(cmd), tempDirPath); |
|
|
89 |
|
getRunner()(std::move(cmd), tempDirPath); |
| 92 |
90 |
|
|
| 93 |
91 |
for (fs::directory_entry &e : |
for (fs::directory_entry &e : |
| 94 |
92 |
fs::recursive_directory_iterator(tempDirPath)) { |
fs::recursive_directory_iterator(tempDirPath)) { |
| |
| ... |
... |
GcovImporter::isExcluded(boost::filesystem::path path) const |
| 204 |
202 |
} |
} |
| 205 |
203 |
return false; |
return false; |
| 206 |
204 |
} |
} |
|
205 |
|
|
|
206 |
|
std::function<GcovImporter::runner_f> & |
|
207 |
|
GcovImporter::getRunner() |
|
208 |
|
{ |
|
209 |
|
static std::function<runner_f> runner; |
|
210 |
|
return runner; |
|
211 |
|
} |
| File src/GcovImporter.hpp changed (mode: 100644) (index 26d20d8..aa79b47) |
| ... |
... |
private: |
| 86 |
86 |
bool isExcluded(boost::filesystem::path path) const; |
bool isExcluded(boost::filesystem::path path) const; |
| 87 |
87 |
|
|
| 88 |
88 |
private: |
private: |
| 89 |
|
//! Runner of external commands. |
|
| 90 |
|
static std::function<runner_f> runner; |
|
|
89 |
|
/** |
|
90 |
|
* @brief Retrieves variable holding runner of external commands. |
|
91 |
|
* |
|
92 |
|
* @returns The runner variable. |
|
93 |
|
*/ |
|
94 |
|
static std::function<runner_f> & getRunner(); |
| 91 |
95 |
|
|
| 92 |
96 |
private: |
private: |
| 93 |
97 |
//! Absolute and normalized path of the source repository. |
//! Absolute and normalized path of the source repository. |