@@ -115,7 +115,7 @@ static void from_str(const String& str, int type, void* dst)
115
115
116
116
void CommandLineParser::getByName (const String& name, bool space_delete, int type, void * dst) const
117
117
{
118
- try
118
+ CV_TRY
119
119
{
120
120
for (size_t i = 0 ; i < impl->data .size (); i++)
121
121
{
@@ -140,20 +140,19 @@ void CommandLineParser::getByName(const String& name, bool space_delete, int typ
140
140
}
141
141
}
142
142
}
143
- catch (Exception& e)
143
+ CV_CATCH (Exception, e)
144
144
{
145
145
impl->error = true ;
146
146
impl->error_message = impl->error_message + " Parameter '" + name + " ': " + e.err + " \n " ;
147
147
return ;
148
148
}
149
-
150
149
CV_Error_ (Error::StsBadArg, (" undeclared key '%s' requested" , name.c_str ()));
151
150
}
152
151
153
152
154
153
void CommandLineParser::getByIndex (int index, bool space_delete, int type, void * dst) const
155
154
{
156
- try
155
+ CV_TRY
157
156
{
158
157
for (size_t i = 0 ; i < impl->data .size (); i++)
159
158
{
@@ -173,13 +172,12 @@ void CommandLineParser::getByIndex(int index, bool space_delete, int type, void*
173
172
}
174
173
}
175
174
}
176
- catch (Exception& e)
175
+ CV_CATCH (Exception, e)
177
176
{
178
177
impl->error = true ;
179
178
impl->error_message = impl->error_message + format (" Parameter #%d: " , index) + e.err + " \n " ;
180
179
return ;
181
180
}
182
-
183
181
CV_Error_ (Error::StsBadArg, (" undeclared position %d requested" , index));
184
182
}
185
183
@@ -454,14 +452,13 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
454
452
std::vector<String> vec;
455
453
String word = " " ;
456
454
bool begin = false ;
457
-
458
455
while (!str.empty ())
459
456
{
460
457
if (str[0 ] == fs)
461
458
{
462
459
if (begin == true )
463
460
{
464
- throw cv::Exception (CV_StsParseError,
461
+ CV_THROW ( cv::Exception (CV_StsParseError,
465
462
String (" error in split_range_string(" )
466
463
+ str
467
464
+ String (" , " )
@@ -470,7 +467,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
470
467
+ String (1 , ss)
471
468
+ String (" )" ),
472
469
" " , __FILE__, __LINE__
473
- );
470
+ )) ;
474
471
}
475
472
begin = true ;
476
473
word = " " ;
@@ -481,7 +478,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
481
478
{
482
479
if (begin == false )
483
480
{
484
- throw cv::Exception (CV_StsParseError,
481
+ CV_THROW ( cv::Exception (CV_StsParseError,
485
482
String (" error in split_range_string(" )
486
483
+ str
487
484
+ String (" , " )
@@ -490,7 +487,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
490
487
+ String (1 , ss)
491
488
+ String (" )" ),
492
489
" " , __FILE__, __LINE__
493
- );
490
+ )) ;
494
491
}
495
492
begin = false ;
496
493
vec.push_back (word);
@@ -505,7 +502,7 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
505
502
506
503
if (begin == true )
507
504
{
508
- throw cv::Exception (CV_StsParseError,
505
+ CV_THROW ( cv::Exception (CV_StsParseError,
509
506
String (" error in split_range_string(" )
510
507
+ str
511
508
+ String (" , " )
@@ -514,9 +511,8 @@ std::vector<String> CommandLineParser::Impl::split_range_string(const String& _s
514
511
+ String (1 , ss)
515
512
+ String (" )" ),
516
513
" " , __FILE__, __LINE__
517
- );
514
+ )) ;
518
515
}
519
-
520
516
return vec;
521
517
}
522
518
0 commit comments