From: Leonid Beynenson Date: Thu, 20 Sep 2012 13:58:44 +0000 (+0400) Subject: Changed CommandLineParser to make it less verbose X-Git-Tag: accepted/2.0/20130307.220821~364^2~185 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0bde00a88a210908bf82602fa79d2fd055fe1949;p=profile%2Fivi%2Fopencv.git Changed CommandLineParser to make it less verbose when it is unrequired. --- diff --git a/modules/core/src/command_line_parser.cpp b/modules/core/src/command_line_parser.cpp index 3dbb1ac..8f998ab 100644 --- a/modules/core/src/command_line_parser.cpp +++ b/modules/core/src/command_line_parser.cpp @@ -72,14 +72,14 @@ static void from_str(const string& str, int type, void* dst) else if( type == Param::STRING ) ss >> *(string*)dst; else - CV_Error(CV_StsBadArg, "unknown/unsupported parameter type"); + throw cv::Exception(CV_StsBadArg, "unknown/unsupported parameter type", __func__, __FILE__, __LINE__); if (ss.fail()) { string err_msg = "can not convert: [" + str + + "] to [" + get_type_name(type) + "]"; - CV_Error(CV_StsBadArg, err_msg); + throw cv::Exception(CV_StsBadArg, err_msg, __func__, __FILE__, __LINE__); } } @@ -417,14 +417,15 @@ vector CommandLineParser::Impl::split_range_string(const string& _str, c { if (begin == true) { - CV_Error(CV_StsParseError, + throw cv::Exception(CV_StsParseError, string("error in split_range_string(") + str + string(", ") + string(1, fs) + string(", ") + string(1, ss) - + string(")") + + string(")"), + __func__, __FILE__, __LINE__ ); } begin = true; @@ -436,14 +437,15 @@ vector CommandLineParser::Impl::split_range_string(const string& _str, c { if (begin == false) { - CV_Error(CV_StsParseError, + throw cv::Exception(CV_StsParseError, string("error in split_range_string(") + str + string(", ") + string(1, fs) + string(", ") + string(1, ss) - + string(")") + + string(")"), + __func__, __FILE__, __LINE__ ); } begin = false; @@ -459,15 +461,16 @@ vector CommandLineParser::Impl::split_range_string(const string& _str, c if (begin == true) { - CV_Error(CV_StsParseError, + throw cv::Exception(CV_StsParseError, string("error in split_range_string(") + str + string(", ") + string(1, fs) + string(", ") + string(1, ss) - + string(")") - ); + + string(")"), + __func__, __FILE__, __LINE__ + ); } return vec;