mirror of
https://github.com/opencv/opencv.git
synced 2026-07-28 23:03:03 +04:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
@@ -119,7 +119,7 @@ static void from_str(const String& str, Param type, void* dst)
|
||||
|
||||
void CommandLineParser::getByName(const String& name, bool space_delete, Param type, void* dst) const
|
||||
{
|
||||
CV_TRY
|
||||
try
|
||||
{
|
||||
for (size_t i = 0; i < impl->data.size(); i++)
|
||||
{
|
||||
@@ -144,19 +144,20 @@ void CommandLineParser::getByName(const String& name, bool space_delete, Param t
|
||||
}
|
||||
}
|
||||
}
|
||||
CV_CATCH (Exception, e)
|
||||
catch (const Exception& e)
|
||||
{
|
||||
impl->error = true;
|
||||
impl->error_message = impl->error_message + "Parameter '"+ name + "': " + e.err + "\n";
|
||||
return;
|
||||
}
|
||||
|
||||
CV_Error_(Error::StsBadArg, ("undeclared key '%s' requested", name.c_str()));
|
||||
}
|
||||
|
||||
|
||||
void CommandLineParser::getByIndex(int index, bool space_delete, Param type, void* dst) const
|
||||
{
|
||||
CV_TRY
|
||||
try
|
||||
{
|
||||
for (size_t i = 0; i < impl->data.size(); i++)
|
||||
{
|
||||
@@ -176,12 +177,13 @@ void CommandLineParser::getByIndex(int index, bool space_delete, Param type, voi
|
||||
}
|
||||
}
|
||||
}
|
||||
CV_CATCH(Exception, e)
|
||||
catch (const Exception& e)
|
||||
{
|
||||
impl->error = true;
|
||||
impl->error_message = impl->error_message + format("Parameter #%d: ", index) + e.err + "\n";
|
||||
return;
|
||||
}
|
||||
|
||||
CV_Error_(Error::StsBadArg, ("undeclared position %d requested", index));
|
||||
}
|
||||
|
||||
@@ -455,13 +457,14 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
|
||||
std::vector<String> vec;
|
||||
String word = "";
|
||||
bool begin = false;
|
||||
|
||||
while (!str.empty())
|
||||
{
|
||||
if (str[0] == fs)
|
||||
{
|
||||
if (begin == true)
|
||||
{
|
||||
CV_THROW (cv::Exception(CV_StsParseError,
|
||||
throw cv::Exception(CV_StsParseError,
|
||||
String("error in split_range_string(")
|
||||
+ str
|
||||
+ String(", ")
|
||||
@@ -470,7 +473,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
|
||||
+ String(1, ss)
|
||||
+ String(")"),
|
||||
"", __FILE__, __LINE__
|
||||
));
|
||||
);
|
||||
}
|
||||
begin = true;
|
||||
word = "";
|
||||
@@ -481,7 +484,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
|
||||
{
|
||||
if (begin == false)
|
||||
{
|
||||
CV_THROW (cv::Exception(CV_StsParseError,
|
||||
throw cv::Exception(CV_StsParseError,
|
||||
String("error in split_range_string(")
|
||||
+ str
|
||||
+ String(", ")
|
||||
@@ -490,7 +493,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
|
||||
+ String(1, ss)
|
||||
+ String(")"),
|
||||
"", __FILE__, __LINE__
|
||||
));
|
||||
);
|
||||
}
|
||||
begin = false;
|
||||
vec.push_back(word);
|
||||
@@ -505,7 +508,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
|
||||
|
||||
if (begin == true)
|
||||
{
|
||||
CV_THROW (cv::Exception(CV_StsParseError,
|
||||
throw cv::Exception(CV_StsParseError,
|
||||
String("error in split_range_string(")
|
||||
+ str
|
||||
+ String(", ")
|
||||
@@ -514,8 +517,9 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
|
||||
+ String(1, ss)
|
||||
+ String(")"),
|
||||
"", __FILE__, __LINE__
|
||||
));
|
||||
);
|
||||
}
|
||||
|
||||
return vec;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user