mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
core: std::string more changes
This commit is contained in:
@@ -72,14 +72,9 @@ static const char* get_type_name(int type)
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
// std::tolower is int->int
|
||||
static char char_tolower(char ch)
|
||||
{
|
||||
return (char)std::tolower((int)ch);
|
||||
}
|
||||
static bool parse_bool(std::string str)
|
||||
{
|
||||
std::transform(str.begin(), str.end(), str.begin(), char_tolower);
|
||||
std::transform(str.begin(), str.end(), str.begin(), details::char_tolower);
|
||||
std::istringstream is(str);
|
||||
bool b;
|
||||
is >> (str.size() > 1 ? std::boolalpha : std::noboolalpha) >> b;
|
||||
|
||||
@@ -1691,11 +1691,6 @@ static cl_device_id selectOpenCLDevice()
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
// std::tolower is int->int
|
||||
static char char_tolower(char ch)
|
||||
{
|
||||
return (char)std::tolower((int)ch);
|
||||
}
|
||||
static cl_device_id selectOpenCLDevice()
|
||||
{
|
||||
std::string platform, deviceName;
|
||||
@@ -1780,7 +1775,7 @@ static cl_device_id selectOpenCLDevice()
|
||||
{
|
||||
int deviceType = 0;
|
||||
std::string tempStrDeviceType = deviceTypes[t];
|
||||
std::transform(tempStrDeviceType.begin(), tempStrDeviceType.end(), tempStrDeviceType.begin(), char_tolower);
|
||||
std::transform(tempStrDeviceType.begin(), tempStrDeviceType.end(), tempStrDeviceType.begin(), details::char_tolower);
|
||||
|
||||
if (tempStrDeviceType == "gpu" || tempStrDeviceType == "dgpu" || tempStrDeviceType == "igpu")
|
||||
deviceType = Device::TYPE_GPU;
|
||||
|
||||
@@ -667,11 +667,6 @@ void read(const FileNode& node, double& value, double default_value)
|
||||
CV_NODE_IS_REAL(node.node->tag) ? node.node->data.f : std::numeric_limits<double>::max();
|
||||
}
|
||||
|
||||
void read(const FileNode& node, String& value, const String& default_value)
|
||||
{
|
||||
value = !node.node ? default_value : CV_NODE_IS_STRING(node.node->tag) ? String(node.node->data.str.ptr) : String();
|
||||
}
|
||||
|
||||
void read(const FileNode& node, std::string& value, const std::string& default_value)
|
||||
{
|
||||
value = !node.node ? default_value : CV_NODE_IS_STRING(node.node->tag) ? std::string(node.node->data.str.ptr) : default_value;
|
||||
|
||||
@@ -1970,7 +1970,7 @@ public:
|
||||
const Ipp64u minorFeatures = 0;
|
||||
#endif
|
||||
|
||||
env = env.toLowerCase();
|
||||
env = toLowerCase(env);
|
||||
if(env.substr(0, 2) == "ne")
|
||||
{
|
||||
useIPP_NE = true;
|
||||
|
||||
Reference in New Issue
Block a user