Skip to content
Snippets Groups Projects
Commit b815ebc6 authored by am0ebe's avatar am0ebe
Browse files

.

parent 4df630d6
Branches
No related tags found
No related merge requests found
......@@ -171,13 +171,12 @@ void parse(int argc, char** argv)
cout << "amountFiles: " << amountFiles << endl;
cout << boolalpha << "testMode: " << testMode << endl;
vector<String> x ={
if( !Tools::check({
"camParamFile", camParamFile,
"centerFile", centerFile,
"inputFile", inputFile,
"outputDir", outputDir
};
if( !Tools::check(x))
}))
exit(error::config_filedir);
Tools::maybeAppendSepToDir(outputDir);
......
......@@ -12,33 +12,33 @@ void Tools::print_ruler()
std::cout << "######################################" << std::endl;
}
bool Tools::maybeAppendSepToDir(String& d)
void Tools::maybeAppendSepToDir(cv::String& d)
{
const char SEP = std::filesystem::path::preferred_separator;
if( d.back() != SEP )
d += SEP;
const char SEP = std::filesystem::path::preferred_separator;
if( d.back() != SEP )
d += SEP;
}
auto Tools::check(vector<String>& x)
bool Tools::check(const std::vector<cv::String>& x)
{
bool checkAll = true;
String name, path;
bool checkAll = true;
cv::String name, path;
for (int i{0}; i<x.size()-1; i++)
{
name = x[i];
path = x[++i];
for (uint i{0}; i<x.size()-1; i++)
{
name = x[i];
path = x[++i];
bool check = std::filesystem::exists(path);
if (!check)
std::cerr << name << ": " << path << " [not found!] " << std::endl;
else
std::cout << name << ": " << path << std::endl;
bool check = std::filesystem::exists(path);
if (!check)
std::cerr << name << ": " << path << " [not found!] " << std::endl;
else
std::cout << name << ": " << path << std::endl;
checkAll &= check;
}
checkAll &= check;
}
return checkAll;
return checkAll;
}
std::string Tools::mNzero(int i)
......
......@@ -26,8 +26,8 @@ class Tools
{
public:
static void maybeAppendSepToDir(std::String& d)
static bool check(std::vector<std::String>& x)
static void maybeAppendSepToDir(cv::String&);
static bool check(const std::vector<cv::String>&);
//! print ruler
static void print_ruler();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment