1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +04:00

Revert CV_TRY/CV_CATCH macros

This reverts commit 7349b8f5ce (partially).
This commit is contained in:
Alexander Alekhin
2018-11-08 19:46:25 +03:00
parent e5d7f446d6
commit b74b05d1b3
18 changed files with 119 additions and 118 deletions
+14 -10
View File
@@ -124,7 +124,7 @@ static void from_str(const String& str, int type, void* dst)
void CommandLineParser::getByName(const String& name, bool space_delete, int type, void* dst) const
{
CV_TRY
try
{
for (size_t i = 0; i < impl->data.size(); i++)
{
@@ -149,19 +149,20 @@ void CommandLineParser::getByName(const String& name, bool space_delete, int typ
}
}
}
CV_CATCH (Exception, e)
catch (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, int type, void* dst) const
{
CV_TRY
try
{
for (size_t i = 0; i < impl->data.size(); i++)
{
@@ -181,12 +182,13 @@ void CommandLineParser::getByIndex(int index, bool space_delete, int type, void*
}
}
}
CV_CATCH(Exception, e)
catch(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));
}
@@ -460,13 +462,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(", ")
@@ -475,7 +478,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
+ String(1, ss)
+ String(")"),
"", __FILE__, __LINE__
));
);
}
begin = true;
word = "";
@@ -486,7 +489,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(", ")
@@ -495,7 +498,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
+ String(1, ss)
+ String(")"),
"", __FILE__, __LINE__
));
);
}
begin = false;
vec.push_back(word);
@@ -510,7 +513,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(", ")
@@ -519,8 +522,9 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
+ String(1, ss)
+ String(")"),
"", __FILE__, __LINE__
));
);
}
return vec;
}