mirror of https://github.com/opencv/opencv.git
Open Source Computer Vision Library
https://opencv.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
687 B
25 lines
687 B
12 years ago
|
#include "test_precomp.hpp"
|
||
11 years ago
|
|
||
|
cv::String cv::Path::combine(const String& item1, const String& item2)
|
||
|
{
|
||
|
if (item1.empty())
|
||
|
return item2;
|
||
|
|
||
|
if (item2.empty())
|
||
|
return item1;
|
||
|
|
||
|
char last = item1[item1.size()-1];
|
||
|
|
||
|
bool need_append = last != '/' && last != '\\';
|
||
|
return item1 + (need_append ? "/" : "") + item2;
|
||
|
}
|
||
|
|
||
|
cv::String cv::Path::combine(const String& item1, const String& item2, const String& item3)
|
||
|
{ return combine(combine(item1, item2), item3); }
|
||
|
|
||
|
cv::String cv::Path::change_extension(const String& file, const String& ext)
|
||
|
{
|
||
|
String::size_type pos = file.find_last_of('.');
|
||
|
return pos == String::npos ? file : file.substr(0, pos+1) + ext;
|
||
|
}
|