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

@@ -113,7 +113,7 @@ namespace cv
Exception::Exception() { code = 0; line = 0; }
Exception::Exception(int _code, const std::string& _err, const std::string& _func, const std::string& _file, int _line)
Exception::Exception(int _code, const cv::String& _err, const cv::String& _func, const cv::String& _file, int _line)
: code(_code), err(_err), func(_func), file(_file), line(_line)
{
formatMessage();
@@ -340,27 +340,27 @@ int64 getCPUTickCount(void)
#endif
const std::string& getBuildInformation()
const cv::String& getBuildInformation()
{
static std::string build_info =
static cv::String build_info =
#include "version_string.inc"
;
return build_info;
}
std::string format( const char* fmt, ... )
cv::String format( const char* fmt, ... )
{
char buf[1 << 16];
va_list args;
va_start( args, fmt );
vsprintf( buf, fmt, args );
return std::string(buf);
return cv::String(buf);
}
std::string tempfile( const char* suffix )
cv::String tempfile( const char* suffix )
{
const char *temp_dir = getenv("OPENCV_TEMP_PATH");
std::string fname;
cv::String fname;
#if defined WIN32 || defined _WIN32
char temp_dir2[MAX_PATH + 1] = { 0 };
@@ -372,7 +372,7 @@ std::string tempfile( const char* suffix )
temp_dir = temp_dir2;
}
if(0 == ::GetTempFileNameA(temp_dir, "ocv", 0, temp_file))
return std::string();
return cv::String();
DeleteFileA(temp_file);
@@ -392,12 +392,12 @@ std::string tempfile( const char* suffix )
fname = temp_dir;
char ech = fname[fname.size() - 1];
if(ech != '/' && ech != '\\')
fname += "/";
fname += "__opencv_temp.XXXXXX";
fname = fname + "/";
fname = fname + "__opencv_temp.XXXXXX";
}
const int fd = mkstemp((char*)fname.c_str());
if (fd == -1) return std::string();
if (fd == -1) return cv::String();
close(fd);
remove(fname.c_str());