Compile opencv_test_core with cv::String instead of std::string

All tests passed!
This commit is contained in:
Andrey Kamaev
2013-03-20 17:53:13 +04:00
parent 14bb4cbe1e
commit 762aefd71b
51 changed files with 598 additions and 595 deletions

View File

@@ -96,7 +96,7 @@ template<typename _KeyTp, typename _ValueTp> struct sorted_vector
};
template<typename _ValueTp> inline const _ValueTp* findstr(const sorted_vector<std::string, _ValueTp>& vec,
template<typename _ValueTp> inline const _ValueTp* findstr(const sorted_vector<cv::String, _ValueTp>& vec,
const char* key)
{
if( !key )
@@ -130,7 +130,7 @@ Param::Param()
Param::Param(int _type, bool _readonly, int _offset,
Algorithm::Getter _getter, Algorithm::Setter _setter,
const std::string& _help)
const cv::String& _help)
{
type = _type;
readonly = _readonly;
@@ -142,23 +142,23 @@ Param::Param(int _type, bool _readonly, int _offset,
struct CV_EXPORTS AlgorithmInfoData
{
sorted_vector<std::string, Param> params;
std::string _name;
sorted_vector<cv::String, Param> params;
cv::String _name;
};
static sorted_vector<std::string, Algorithm::Constructor>& alglist()
static sorted_vector<cv::String, Algorithm::Constructor>& alglist()
{
static sorted_vector<std::string, Algorithm::Constructor> alglist_var;
static sorted_vector<cv::String, Algorithm::Constructor> alglist_var;
return alglist_var;
}
void Algorithm::getList(std::vector<std::string>& algorithms)
void Algorithm::getList(std::vector<cv::String>& algorithms)
{
alglist().get_keys(algorithms);
}
Ptr<Algorithm> Algorithm::_create(const std::string& name)
Ptr<Algorithm> Algorithm::_create(const cv::String& name)
{
Algorithm::Constructor c = 0;
if( !alglist().find(name, c) )
@@ -174,42 +174,42 @@ Algorithm::~Algorithm()
{
}
std::string Algorithm::name() const
cv::String Algorithm::name() const
{
return info()->name();
}
void Algorithm::set(const std::string& parameter, int value)
void Algorithm::set(const cv::String& parameter, int value)
{
info()->set(this, parameter.c_str(), ParamType<int>::type, &value);
}
void Algorithm::set(const std::string& parameter, double value)
void Algorithm::set(const cv::String& parameter, double value)
{
info()->set(this, parameter.c_str(), ParamType<double>::type, &value);
}
void Algorithm::set(const std::string& parameter, bool value)
void Algorithm::set(const cv::String& parameter, bool value)
{
info()->set(this, parameter.c_str(), ParamType<bool>::type, &value);
}
void Algorithm::set(const std::string& parameter, const std::string& value)
void Algorithm::set(const cv::String& parameter, const cv::String& value)
{
info()->set(this, parameter.c_str(), ParamType<std::string>::type, &value);
info()->set(this, parameter.c_str(), ParamType<cv::String>::type, &value);
}
void Algorithm::set(const std::string& parameter, const Mat& value)
void Algorithm::set(const cv::String& parameter, const Mat& value)
{
info()->set(this, parameter.c_str(), ParamType<Mat>::type, &value);
}
void Algorithm::set(const std::string& parameter, const std::vector<Mat>& value)
void Algorithm::set(const cv::String& parameter, const std::vector<Mat>& value)
{
info()->set(this, parameter.c_str(), ParamType<std::vector<Mat> >::type, &value);
}
void Algorithm::set(const std::string& parameter, const Ptr<Algorithm>& value)
void Algorithm::set(const cv::String& parameter, const Ptr<Algorithm>& value)
{
info()->set(this, parameter.c_str(), ParamType<Algorithm>::type, &value);
}
@@ -229,9 +229,9 @@ void Algorithm::set(const char* parameter, bool value)
info()->set(this, parameter, ParamType<bool>::type, &value);
}
void Algorithm::set(const char* parameter, const std::string& value)
void Algorithm::set(const char* parameter, const cv::String& value)
{
info()->set(this, parameter, ParamType<std::string>::type, &value);
info()->set(this, parameter, ParamType<cv::String>::type, &value);
}
void Algorithm::set(const char* parameter, const Mat& value)
@@ -250,37 +250,37 @@ void Algorithm::set(const char* parameter, const Ptr<Algorithm>& value)
}
void Algorithm::setInt(const std::string& parameter, int value)
void Algorithm::setInt(const cv::String& parameter, int value)
{
info()->set(this, parameter.c_str(), ParamType<int>::type, &value);
}
void Algorithm::setDouble(const std::string& parameter, double value)
void Algorithm::setDouble(const cv::String& parameter, double value)
{
info()->set(this, parameter.c_str(), ParamType<double>::type, &value);
}
void Algorithm::setBool(const std::string& parameter, bool value)
void Algorithm::setBool(const cv::String& parameter, bool value)
{
info()->set(this, parameter.c_str(), ParamType<bool>::type, &value);
}
void Algorithm::setString(const std::string& parameter, const std::string& value)
void Algorithm::setString(const cv::String& parameter, const cv::String& value)
{
info()->set(this, parameter.c_str(), ParamType<std::string>::type, &value);
info()->set(this, parameter.c_str(), ParamType<cv::String>::type, &value);
}
void Algorithm::setMat(const std::string& parameter, const Mat& value)
void Algorithm::setMat(const cv::String& parameter, const Mat& value)
{
info()->set(this, parameter.c_str(), ParamType<Mat>::type, &value);
}
void Algorithm::setMatVector(const std::string& parameter, const std::vector<Mat>& value)
void Algorithm::setMatVector(const cv::String& parameter, const std::vector<Mat>& value)
{
info()->set(this, parameter.c_str(), ParamType<std::vector<Mat> >::type, &value);
}
void Algorithm::setAlgorithm(const std::string& parameter, const Ptr<Algorithm>& value)
void Algorithm::setAlgorithm(const cv::String& parameter, const Ptr<Algorithm>& value)
{
info()->set(this, parameter.c_str(), ParamType<Algorithm>::type, &value);
}
@@ -300,9 +300,9 @@ void Algorithm::setBool(const char* parameter, bool value)
info()->set(this, parameter, ParamType<bool>::type, &value);
}
void Algorithm::setString(const char* parameter, const std::string& value)
void Algorithm::setString(const char* parameter, const cv::String& value)
{
info()->set(this, parameter, ParamType<std::string>::type, &value);
info()->set(this, parameter, ParamType<cv::String>::type, &value);
}
void Algorithm::setMat(const char* parameter, const Mat& value)
@@ -322,47 +322,47 @@ void Algorithm::setAlgorithm(const char* parameter, const Ptr<Algorithm>& value)
int Algorithm::getInt(const std::string& parameter) const
int Algorithm::getInt(const cv::String& parameter) const
{
return get<int>(parameter);
}
double Algorithm::getDouble(const std::string& parameter) const
double Algorithm::getDouble(const cv::String& parameter) const
{
return get<double>(parameter);
}
bool Algorithm::getBool(const std::string& parameter) const
bool Algorithm::getBool(const cv::String& parameter) const
{
return get<bool>(parameter);
}
std::string Algorithm::getString(const std::string& parameter) const
cv::String Algorithm::getString(const cv::String& parameter) const
{
return get<std::string>(parameter);
return get<cv::String>(parameter);
}
Mat Algorithm::getMat(const std::string& parameter) const
Mat Algorithm::getMat(const cv::String& parameter) const
{
return get<Mat>(parameter);
}
std::vector<Mat> Algorithm::getMatVector(const std::string& parameter) const
std::vector<Mat> Algorithm::getMatVector(const cv::String& parameter) const
{
return get<std::vector<Mat> >(parameter);
}
Ptr<Algorithm> Algorithm::getAlgorithm(const std::string& parameter) const
Ptr<Algorithm> Algorithm::getAlgorithm(const cv::String& parameter) const
{
return get<Algorithm>(parameter);
}
std::string Algorithm::paramHelp(const std::string& parameter) const
cv::String Algorithm::paramHelp(const cv::String& parameter) const
{
return info()->paramHelp(parameter.c_str());
}
int Algorithm::paramType(const std::string& parameter) const
int Algorithm::paramType(const cv::String& parameter) const
{
return info()->paramType(parameter.c_str());
}
@@ -372,7 +372,7 @@ int Algorithm::paramType(const char* parameter) const
return info()->paramType(parameter);
}
void Algorithm::getParams(std::vector<std::string>& names) const
void Algorithm::getParams(std::vector<cv::String>& names) const
{
info()->getParams(names);
}
@@ -388,7 +388,7 @@ void Algorithm::read(const FileNode& fn)
}
AlgorithmInfo::AlgorithmInfo(const std::string& _name, Algorithm::Constructor create)
AlgorithmInfo::AlgorithmInfo(const cv::String& _name, Algorithm::Constructor create)
{
data = new AlgorithmInfoData;
data->_name = _name;
@@ -408,7 +408,7 @@ void AlgorithmInfo::write(const Algorithm* algo, FileStorage& fs) const
for( i = 0; i < nparams; i++ )
{
const Param& p = data->params.vec[i].second;
const std::string& pname = data->params.vec[i].first;
const cv::String& pname = data->params.vec[i].first;
if( p.type == Param::INT )
cv::write(fs, pname, algo->get<int>(pname));
else if( p.type == Param::BOOLEAN )
@@ -416,7 +416,7 @@ void AlgorithmInfo::write(const Algorithm* algo, FileStorage& fs) const
else if( p.type == Param::REAL )
cv::write(fs, pname, algo->get<double>(pname));
else if( p.type == Param::STRING )
cv::write(fs, pname, algo->get<std::string>(pname));
cv::write(fs, pname, algo->get<cv::String>(pname));
else if( p.type == Param::MAT )
cv::write(fs, pname, algo->get<Mat>(pname));
else if( p.type == Param::MAT_VECTOR )
@@ -437,7 +437,7 @@ void AlgorithmInfo::write(const Algorithm* algo, FileStorage& fs) const
cv::write(fs, pname, algo->getInt(pname));
else
{
std::string msg = format("unknown/unsupported type of '%s' parameter == %d", pname.c_str(), p.type);
cv::String msg = format("unknown/unsupported type of '%s' parameter == %d", pname.c_str(), p.type);
CV_Error( CV_StsUnsupportedFormat, msg.c_str());
}
}
@@ -451,7 +451,7 @@ void AlgorithmInfo::read(Algorithm* algo, const FileNode& fn) const
for( i = 0; i < nparams; i++ )
{
const Param& p = data->params.vec[i].second;
const std::string& pname = data->params.vec[i].first;
const cv::String& pname = data->params.vec[i].first;
const FileNode n = fn[pname];
if( n.empty() )
continue;
@@ -472,7 +472,7 @@ void AlgorithmInfo::read(Algorithm* algo, const FileNode& fn) const
}
else if( p.type == Param::STRING )
{
std::string val = (std::string)n;
cv::String val = (cv::String)n;
info->set(algo, pname.c_str(), p.type, &val, true);
}
else if( p.type == Param::MAT )
@@ -489,7 +489,7 @@ void AlgorithmInfo::read(Algorithm* algo, const FileNode& fn) const
}
else if( p.type == Param::ALGORITHM )
{
Ptr<Algorithm> nestedAlgo = Algorithm::_create((std::string)n["name"]);
Ptr<Algorithm> nestedAlgo = Algorithm::_create((cv::String)n["name"]);
CV_Assert( !nestedAlgo.empty() );
nestedAlgo->read(n);
info->set(algo, pname.c_str(), p.type, &nestedAlgo, true);
@@ -516,13 +516,13 @@ void AlgorithmInfo::read(Algorithm* algo, const FileNode& fn) const
}
else
{
std::string msg = format("unknown/unsupported type of '%s' parameter == %d", pname.c_str(), p.type);
cv::String msg = format("unknown/unsupported type of '%s' parameter == %d", pname.c_str(), p.type);
CV_Error( CV_StsUnsupportedFormat, msg.c_str());
}
}
}
std::string AlgorithmInfo::name() const
cv::String AlgorithmInfo::name() const
{
return data->_name;
}
@@ -532,7 +532,7 @@ union GetSetParam
int (Algorithm::*get_int)() const;
bool (Algorithm::*get_bool)() const;
double (Algorithm::*get_double)() const;
std::string (Algorithm::*get_string)() const;
cv::String (Algorithm::*get_string)() const;
Mat (Algorithm::*get_mat)() const;
std::vector<Mat> (Algorithm::*get_mat_vector)() const;
Ptr<Algorithm> (Algorithm::*get_algo)() const;
@@ -544,7 +544,7 @@ union GetSetParam
void (Algorithm::*set_int)(int);
void (Algorithm::*set_bool)(bool);
void (Algorithm::*set_double)(double);
void (Algorithm::*set_string)(const std::string&);
void (Algorithm::*set_string)(const cv::String&);
void (Algorithm::*set_mat)(const Mat&);
void (Algorithm::*set_mat_vector)(const std::vector<Mat>&);
void (Algorithm::*set_algo)(const Ptr<Algorithm>&);
@@ -554,9 +554,9 @@ union GetSetParam
void (Algorithm::*set_uchar)(uchar);
};
static std::string getNameOfType(int argType);
static cv::String getNameOfType(int argType);
static std::string getNameOfType(int argType)
static cv::String getNameOfType(int argType)
{
switch(argType)
{
@@ -576,37 +576,37 @@ static std::string getNameOfType(int argType)
return "";
}
static std::string getErrorMessageForWrongArgumentInSetter(std::string algoName, std::string paramName, int paramType, int argType)
static cv::String getErrorMessageForWrongArgumentInSetter(cv::String algoName, cv::String paramName, int paramType, int argType)
{
std::string message = std::string("Argument error: the setter")
cv::String message = cv::String("Argument error: the setter")
+ " method was called for the parameter '" + paramName + "' of the algorithm '" + algoName
+"', the parameter has " + getNameOfType(paramType) + " type, ";
if (paramType == Param::INT || paramType == Param::BOOLEAN || paramType == Param::REAL
|| paramType == Param::FLOAT || paramType == Param::UNSIGNED_INT || paramType == Param::UINT64 || paramType == Param::UCHAR)
{
message += "so it should be set by integer, unsigned integer, uint64, unsigned char, boolean, float or double value, ";
message = message + "so it should be set by integer, unsigned integer, uint64, unsigned char, boolean, float or double value, ";
}
message += "but the setter was called with " + getNameOfType(argType) + " value";
message = message + "but the setter was called with " + getNameOfType(argType) + " value";
return message;
}
static std::string getErrorMessageForWrongArgumentInGetter(std::string algoName, std::string paramName, int paramType, int argType)
static cv::String getErrorMessageForWrongArgumentInGetter(cv::String algoName, cv::String paramName, int paramType, int argType)
{
std::string message = std::string("Argument error: the getter")
cv::String message = cv::String("Argument error: the getter")
+ " method was called for the parameter '" + paramName + "' of the algorithm '" + algoName
+"', the parameter has " + getNameOfType(paramType) + " type, ";
if (paramType == Param::BOOLEAN)
{
message += "so it should be get as integer, unsigned integer, uint64, boolean, unsigned char, float or double value, ";
message = message + "so it should be get as integer, unsigned integer, uint64, boolean, unsigned char, float or double value, ";
}
else if (paramType == Param::INT || paramType == Param::UNSIGNED_INT || paramType == Param::UINT64 || paramType == Param::UCHAR)
{
message += "so it should be get as integer, unsigned integer, uint64, unsigned char, float or double value, ";
message = message + "so it should be get as integer, unsigned integer, uint64, unsigned char, float or double value, ";
}
message += "but the getter was called to get a " + getNameOfType(argType) + " value";
message = message + "but the getter was called to get a " + getNameOfType(argType) + " value";
return message;
}
@@ -630,7 +630,7 @@ void AlgorithmInfo::set(Algorithm* algo, const char* parameter, int argType, con
if ( !( p->type == Param::INT || p->type == Param::REAL || p->type == Param::BOOLEAN
|| p->type == Param::UNSIGNED_INT || p->type == Param::UINT64 || p->type == Param::FLOAT || argType == Param::UCHAR) )
{
std::string message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
@@ -790,21 +790,21 @@ void AlgorithmInfo::set(Algorithm* algo, const char* parameter, int argType, con
{
if( p->type != Param::STRING )
{
std::string message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
const std::string& val = *(const std::string*)value;
const cv::String& val = *(const cv::String*)value;
if( p->setter )
(algo->*f.set_string)(val);
else
*(std::string*)((uchar*)algo + p->offset) = val;
*(cv::String*)((uchar*)algo + p->offset) = val;
}
else if( argType == Param::MAT )
{
if( p->type != Param::MAT )
{
std::string message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
@@ -818,7 +818,7 @@ void AlgorithmInfo::set(Algorithm* algo, const char* parameter, int argType, con
{
if( p->type != Param::MAT_VECTOR )
{
std::string message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
@@ -832,7 +832,7 @@ void AlgorithmInfo::set(Algorithm* algo, const char* parameter, int argType, con
{
if( p->type != Param::ALGORITHM )
{
std::string message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
@@ -862,7 +862,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if (!( argType == Param::INT || argType == Param::REAL || argType == Param::FLOAT || argType == Param::UNSIGNED_INT || argType == Param::UINT64 || argType == Param::UCHAR))
{
std::string message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
int val = p->getter ? (algo->*f.get_int)() : *(int*)((uchar*)algo + p->offset);
@@ -887,7 +887,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if (!( argType == Param::INT || argType == Param::BOOLEAN || argType == Param::REAL || argType == Param::FLOAT || argType == Param::UNSIGNED_INT || argType == Param::UINT64 || argType == Param::UCHAR))
{
std::string message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
bool val = p->getter ? (algo->*f.get_bool)() : *(bool*)((uchar*)algo + p->offset);
@@ -913,7 +913,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if(!( argType == Param::REAL || argType == Param::FLOAT))
{
std::string message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
double val = p->getter ? (algo->*f.get_double)() : *(double*)((uchar*)algo + p->offset);
@@ -929,7 +929,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if(!( argType == Param::REAL || argType == Param::FLOAT))
{
std::string message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
float val = p->getter ? (algo->*f.get_float)() : *(float*)((uchar*)algo + p->offset);
@@ -945,7 +945,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if (!( argType == Param::INT || argType == Param::REAL || argType == Param::FLOAT || argType == Param::UNSIGNED_INT || argType == Param::UINT64 || argType == Param::UCHAR))
{
std::string message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
unsigned int val = p->getter ? (algo->*f.get_uint)() : *(unsigned int*)((uchar*)algo + p->offset);
@@ -969,7 +969,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if (!( argType == Param::INT || argType == Param::REAL || argType == Param::FLOAT || argType == Param::UNSIGNED_INT || argType == Param::UINT64 || argType == Param::UCHAR))
{
std::string message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
uint64 val = p->getter ? (algo->*f.get_uint64)() : *(uint64*)((uchar*)algo + p->offset);
@@ -993,7 +993,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if (!( argType == Param::INT || argType == Param::REAL || argType == Param::FLOAT || argType == Param::UNSIGNED_INT || argType == Param::UINT64 || argType == Param::UCHAR))
{
std::string message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
uchar val = p->getter ? (algo->*f.get_uchar)() : *(uchar*)((uchar*)algo + p->offset);
@@ -1021,18 +1021,18 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if( p->type != Param::STRING )
{
std::string message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
*(std::string*)value = p->getter ? (algo->*f.get_string)() :
*(std::string*)((uchar*)algo + p->offset);
*(cv::String*)value = p->getter ? (algo->*f.get_string)() :
*(cv::String*)((uchar*)algo + p->offset);
}
else if( argType == Param::MAT )
{
if( p->type != Param::MAT )
{
std::string message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
@@ -1043,7 +1043,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if( p->type != Param::MAT_VECTOR )
{
std::string message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
@@ -1054,7 +1054,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
{
if( p->type != Param::ALGORITHM )
{
std::string message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
@@ -1063,7 +1063,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
}
else
{
std::string message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
cv::String message = getErrorMessageForWrongArgumentInGetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message);
}
}
@@ -1078,7 +1078,7 @@ int AlgorithmInfo::paramType(const char* parameter) const
}
std::string AlgorithmInfo::paramHelp(const char* parameter) const
cv::String AlgorithmInfo::paramHelp(const char* parameter) const
{
const Param* p = findstr(data->params, parameter);
if( !p )
@@ -1087,7 +1087,7 @@ std::string AlgorithmInfo::paramHelp(const char* parameter) const
}
void AlgorithmInfo::getParams(std::vector<std::string>& names) const
void AlgorithmInfo::getParams(std::vector<cv::String>& names) const
{
data->params.get_keys(names);
}
@@ -1096,7 +1096,7 @@ void AlgorithmInfo::getParams(std::vector<std::string>& names) const
void AlgorithmInfo::addParam_(Algorithm& algo, const char* parameter, int argType,
void* value, bool readOnly,
Algorithm::Getter getter, Algorithm::Setter setter,
const std::string& help)
const cv::String& help)
{
CV_Assert( argType == Param::INT || argType == Param::BOOLEAN ||
argType == Param::REAL || argType == Param::STRING ||
@@ -1104,7 +1104,7 @@ void AlgorithmInfo::addParam_(Algorithm& algo, const char* parameter, int argTyp
argType == Param::ALGORITHM
|| argType == Param::FLOAT || argType == Param::UNSIGNED_INT || argType == Param::UINT64
|| argType == Param::UCHAR);
data->params.add(std::string(parameter), Param(argType, readOnly,
data->params.add(cv::String(parameter), Param(argType, readOnly,
(int)((size_t)value - (size_t)(void*)&algo),
getter, setter, help));
}
@@ -1114,7 +1114,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
int& value, bool readOnly,
int (Algorithm::*getter)(),
void (Algorithm::*setter)(int),
const std::string& help)
const cv::String& help)
{
addParam_(algo, parameter, ParamType<int>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
@@ -1124,7 +1124,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
bool& value, bool readOnly,
int (Algorithm::*getter)(),
void (Algorithm::*setter)(int),
const std::string& help)
const cv::String& help)
{
addParam_(algo, parameter, ParamType<bool>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
@@ -1134,19 +1134,19 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
double& value, bool readOnly,
double (Algorithm::*getter)(),
void (Algorithm::*setter)(double),
const std::string& help)
const cv::String& help)
{
addParam_(algo, parameter, ParamType<double>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
}
void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
std::string& value, bool readOnly,
std::string (Algorithm::*getter)(),
void (Algorithm::*setter)(const std::string&),
const std::string& help)
cv::String& value, bool readOnly,
cv::String (Algorithm::*getter)(),
void (Algorithm::*setter)(const cv::String&),
const cv::String& help)
{
addParam_(algo, parameter, ParamType<std::string>::type, &value, readOnly,
addParam_(algo, parameter, ParamType<cv::String>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
}
@@ -1154,7 +1154,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
Mat& value, bool readOnly,
Mat (Algorithm::*getter)(),
void (Algorithm::*setter)(const Mat&),
const std::string& help)
const cv::String& help)
{
addParam_(algo, parameter, ParamType<Mat>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
@@ -1164,7 +1164,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
std::vector<Mat>& value, bool readOnly,
std::vector<Mat> (Algorithm::*getter)(),
void (Algorithm::*setter)(const std::vector<Mat>&),
const std::string& help)
const cv::String& help)
{
addParam_(algo, parameter, ParamType<std::vector<Mat> >::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
@@ -1174,7 +1174,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
Ptr<Algorithm>& value, bool readOnly,
Ptr<Algorithm> (Algorithm::*getter)(),
void (Algorithm::*setter)(const Ptr<Algorithm>&),
const std::string& help)
const cv::String& help)
{
addParam_(algo, parameter, ParamType<Algorithm>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
@@ -1184,7 +1184,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
float& value, bool readOnly,
float (Algorithm::*getter)(),
void (Algorithm::*setter)(float),
const std::string& help)
const cv::String& help)
{
addParam_(algo, parameter, ParamType<float>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
@@ -1194,7 +1194,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
unsigned int& value, bool readOnly,
unsigned int (Algorithm::*getter)(),
void (Algorithm::*setter)(unsigned int),
const std::string& help)
const cv::String& help)
{
addParam_(algo, parameter, ParamType<unsigned int>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
@@ -1204,7 +1204,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
uint64& value, bool readOnly,
uint64 (Algorithm::*getter)(),
void (Algorithm::*setter)(uint64),
const std::string& help)
const cv::String& help)
{
addParam_(algo, parameter, ParamType<uint64>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
@@ -1214,7 +1214,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
uchar& value, bool readOnly,
uchar (Algorithm::*getter)(),
void (Algorithm::*setter)(uchar),
const std::string& help)
const cv::String& help)
{
addParam_(algo, parameter, ParamType<uchar>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);