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

Build for embedded systems

This commit is contained in:
Maksim Shabunin
2017-11-28 12:53:40 +03:00
parent 9665dde678
commit 7349b8f5ce
25 changed files with 184 additions and 135 deletions
+10 -14
View File
@@ -115,7 +115,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
{
try
CV_TRY
{
for (size_t i = 0; i < impl->data.size(); i++)
{
@@ -140,20 +140,19 @@ void CommandLineParser::getByName(const String& name, bool space_delete, int typ
}
}
}
catch (Exception& e)
CV_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
{
try
CV_TRY
{
for (size_t i = 0; i < impl->data.size(); i++)
{
@@ -173,13 +172,12 @@ void CommandLineParser::getByIndex(int index, bool space_delete, int type, void*
}
}
}
catch(Exception& e)
CV_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));
}
@@ -454,14 +452,13 @@ 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)
{
throw cv::Exception(CV_StsParseError,
CV_THROW (cv::Exception(CV_StsParseError,
String("error in split_range_string(")
+ str
+ String(", ")
@@ -470,7 +467,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
+ String(1, ss)
+ String(")"),
"", __FILE__, __LINE__
);
));
}
begin = true;
word = "";
@@ -481,7 +478,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
{
if (begin == false)
{
throw cv::Exception(CV_StsParseError,
CV_THROW (cv::Exception(CV_StsParseError,
String("error in split_range_string(")
+ str
+ String(", ")
@@ -490,7 +487,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 +502,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
if (begin == true)
{
throw cv::Exception(CV_StsParseError,
CV_THROW (cv::Exception(CV_StsParseError,
String("error in split_range_string(")
+ str
+ String(", ")
@@ -514,9 +511,8 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
+ String(1, ss)
+ String(")"),
"", __FILE__, __LINE__
);
));
}
return vec;
}