v1.1.4 : Output more human readable and no more useless alias for namespace

This commit is contained in:
Brendan LE GLAUNEC
2016-12-02 16:28:41 +01:00
parent 369728f6c3
commit 1fc21f0906
3 changed files with 14 additions and 10 deletions
+11 -7
View File
@@ -21,24 +21,28 @@ namespace cameradar {
// Uses the subnets specified in the conf file to launch nmap
bool
print::run() const {
bool first = true;
std::vector<stream_model> results = (*cache)->get_valid_streams();
std::ofstream file;
bool first = true;
file.open("/tmp/shared/result.json");
file.open(default_result_file_path);
if (file.fail()) {
LOG_ERR_("Result file could not be opened : " + default_result_file_path, "print");
return false;
}
file << "[\n";
for (const auto& stream : results) {
LOG_INFO_("Found a valid RTSP Stream and generated a thumbnail at : " +
stream.thumbnail_path,
"print");
file << deserialize(stream).toStyledString();
if (first)
first = false;
else
file << ",";
file << deserialize(stream).toStyledString();
LOG_INFO_("Generated JSON Result : " + deserialize(stream).toStyledString(), "print");
}
file << "\n]";
file << "]";
file.close();
return true;
}