Drop cv:: prefix from cv::String used inside the cv namespace
This commit is contained in:
@@ -152,7 +152,7 @@ cv::String cv::FileStorage::getDefaultObjectName(const cv::String& _filename)
|
||||
name = name_buf;
|
||||
if( strcmp( name, "_" ) == 0 )
|
||||
strcpy( name, stubname );
|
||||
return cv::String(name);
|
||||
return String(name);
|
||||
}
|
||||
|
||||
typedef struct CvGenericHash
|
||||
@@ -5104,7 +5104,7 @@ stop_search:
|
||||
namespace cv
|
||||
{
|
||||
|
||||
static void getElemSize( const cv::String& fmt, size_t& elemSize, size_t& cn )
|
||||
static void getElemSize( const String& fmt, size_t& elemSize, size_t& cn )
|
||||
{
|
||||
const char* dt = fmt.c_str();
|
||||
cn = 1;
|
||||
@@ -5124,7 +5124,7 @@ FileStorage::FileStorage()
|
||||
state = UNDEFINED;
|
||||
}
|
||||
|
||||
FileStorage::FileStorage(const cv::String& filename, int flags, const cv::String& encoding)
|
||||
FileStorage::FileStorage(const String& filename, int flags, const String& encoding)
|
||||
{
|
||||
state = UNDEFINED;
|
||||
open( filename, flags, encoding );
|
||||
@@ -5145,7 +5145,7 @@ FileStorage::~FileStorage()
|
||||
}
|
||||
}
|
||||
|
||||
bool FileStorage::open(const cv::String& filename, int flags, const cv::String& encoding)
|
||||
bool FileStorage::open(const String& filename, int flags, const String& encoding)
|
||||
{
|
||||
release();
|
||||
fs = Ptr<CvFileStorage>(cvOpenFileStorage( filename.c_str(), 0, flags,
|
||||
@@ -5167,9 +5167,9 @@ void FileStorage::release()
|
||||
state = UNDEFINED;
|
||||
}
|
||||
|
||||
cv::String FileStorage::releaseAndGetString()
|
||||
String FileStorage::releaseAndGetString()
|
||||
{
|
||||
cv::String buf;
|
||||
String buf;
|
||||
if( fs.obj && fs.obj->outbuf )
|
||||
icvClose(fs.obj, &buf);
|
||||
|
||||
@@ -5182,7 +5182,7 @@ FileNode FileStorage::root(int streamidx) const
|
||||
return isOpened() ? FileNode(fs, cvGetRootFileNode(fs, streamidx)) : FileNode();
|
||||
}
|
||||
|
||||
FileStorage& operator << (FileStorage& fs, const cv::String& str)
|
||||
FileStorage& operator << (FileStorage& fs, const String& str)
|
||||
{
|
||||
enum { NAME_EXPECTED = FileStorage::NAME_EXPECTED,
|
||||
VALUE_EXPECTED = FileStorage::VALUE_EXPECTED,
|
||||
@@ -5201,7 +5201,7 @@ FileStorage& operator << (FileStorage& fs, const cv::String& str)
|
||||
fs.state = fs.structs.empty() || fs.structs.back() == '{' ?
|
||||
INSIDE_MAP + NAME_EXPECTED : VALUE_EXPECTED;
|
||||
cvEndWriteStruct( *fs );
|
||||
fs.elname = cv::String();
|
||||
fs.elname = String();
|
||||
}
|
||||
else if( fs.state == NAME_EXPECTED + INSIDE_MAP )
|
||||
{
|
||||
@@ -5225,12 +5225,12 @@ FileStorage& operator << (FileStorage& fs, const cv::String& str)
|
||||
}
|
||||
cvStartWriteStruct( *fs, fs.elname.size() > 0 ? fs.elname.c_str() : 0,
|
||||
flags, *_str ? _str : 0 );
|
||||
fs.elname = cv::String();
|
||||
fs.elname = String();
|
||||
}
|
||||
else
|
||||
{
|
||||
write( fs, fs.elname, (_str[0] == '\\' && (_str[1] == '{' || _str[1] == '}' ||
|
||||
_str[1] == '[' || _str[1] == ']')) ? cv::String(_str+1) : str );
|
||||
_str[1] == '[' || _str[1] == ']')) ? String(_str+1) : str );
|
||||
if( fs.state == INSIDE_MAP + VALUE_EXPECTED )
|
||||
fs.state = INSIDE_MAP + NAME_EXPECTED;
|
||||
}
|
||||
@@ -5241,7 +5241,7 @@ FileStorage& operator << (FileStorage& fs, const cv::String& str)
|
||||
}
|
||||
|
||||
|
||||
void FileStorage::writeRaw( const cv::String& fmt, const uchar* vec, size_t len )
|
||||
void FileStorage::writeRaw( const String& fmt, const uchar* vec, size_t len )
|
||||
{
|
||||
if( !isOpened() )
|
||||
return;
|
||||
@@ -5252,7 +5252,7 @@ void FileStorage::writeRaw( const cv::String& fmt, const uchar* vec, size_t len
|
||||
}
|
||||
|
||||
|
||||
void FileStorage::writeObj( const cv::String& name, const void* obj )
|
||||
void FileStorage::writeObj( const String& name, const void* obj )
|
||||
{
|
||||
if( !isOpened() )
|
||||
return;
|
||||
@@ -5260,7 +5260,7 @@ void FileStorage::writeObj( const cv::String& name, const void* obj )
|
||||
}
|
||||
|
||||
|
||||
FileNode FileStorage::operator[](const cv::String& nodename) const
|
||||
FileNode FileStorage::operator[](const String& nodename) const
|
||||
{
|
||||
return FileNode(fs, cvGetFileNodeByName(fs, 0, nodename.c_str()));
|
||||
}
|
||||
@@ -5270,7 +5270,7 @@ FileNode FileStorage::operator[](const char* nodename) const
|
||||
return FileNode(fs, cvGetFileNodeByName(fs, 0, nodename));
|
||||
}
|
||||
|
||||
FileNode FileNode::operator[](const cv::String& nodename) const
|
||||
FileNode FileNode::operator[](const String& nodename) const
|
||||
{
|
||||
return FileNode(fs, cvGetFileNodeByName(fs, node, nodename.c_str()));
|
||||
}
|
||||
@@ -5286,10 +5286,10 @@ FileNode FileNode::operator[](int i) const
|
||||
i == 0 ? *this : FileNode();
|
||||
}
|
||||
|
||||
cv::String FileNode::name() const
|
||||
String FileNode::name() const
|
||||
{
|
||||
const char* str;
|
||||
return !node || (str = cvGetFileNodeName(node)) == 0 ? cv::String() : cv::String(str);
|
||||
return !node || (str = cvGetFileNodeName(node)) == 0 ? String() : String(str);
|
||||
}
|
||||
|
||||
void* FileNode::readObj() const
|
||||
@@ -5404,7 +5404,7 @@ FileNodeIterator& FileNodeIterator::operator -= (int ofs)
|
||||
}
|
||||
|
||||
|
||||
FileNodeIterator& FileNodeIterator::readRaw( const cv::String& fmt, uchar* vec, size_t maxCount )
|
||||
FileNodeIterator& FileNodeIterator::readRaw( const String& fmt, uchar* vec, size_t maxCount )
|
||||
{
|
||||
if( fs && container && remaining > 0 )
|
||||
{
|
||||
@@ -5428,16 +5428,16 @@ FileNodeIterator& FileNodeIterator::readRaw( const cv::String& fmt, uchar* vec,
|
||||
}
|
||||
|
||||
|
||||
void write( FileStorage& fs, const cv::String& name, int value )
|
||||
void write( FileStorage& fs, const String& name, int value )
|
||||
{ cvWriteInt( *fs, name.size() ? name.c_str() : 0, value ); }
|
||||
|
||||
void write( FileStorage& fs, const cv::String& name, float value )
|
||||
void write( FileStorage& fs, const String& name, float value )
|
||||
{ cvWriteReal( *fs, name.size() ? name.c_str() : 0, value ); }
|
||||
|
||||
void write( FileStorage& fs, const cv::String& name, double value )
|
||||
void write( FileStorage& fs, const String& name, double value )
|
||||
{ cvWriteReal( *fs, name.size() ? name.c_str() : 0, value ); }
|
||||
|
||||
void write( FileStorage& fs, const cv::String& name, const cv::String& value )
|
||||
void write( FileStorage& fs, const String& name, const String& value )
|
||||
{ cvWriteString( *fs, name.size() ? name.c_str() : 0, value.c_str() ); }
|
||||
|
||||
void writeScalar(FileStorage& fs, int value )
|
||||
@@ -5449,11 +5449,11 @@ void writeScalar(FileStorage& fs, float value )
|
||||
void writeScalar(FileStorage& fs, double value )
|
||||
{ cvWriteReal( *fs, 0, value ); }
|
||||
|
||||
void writeScalar(FileStorage& fs, const cv::String& value )
|
||||
void writeScalar(FileStorage& fs, const String& value )
|
||||
{ cvWriteString( *fs, 0, value.c_str() ); }
|
||||
|
||||
|
||||
void write( FileStorage& fs, const cv::String& name, const Mat& value )
|
||||
void write( FileStorage& fs, const String& name, const Mat& value )
|
||||
{
|
||||
if( value.dims <= 2 )
|
||||
{
|
||||
@@ -5468,15 +5468,15 @@ void write( FileStorage& fs, const cv::String& name, const Mat& value )
|
||||
}
|
||||
|
||||
// TODO: the 4 functions below need to be implemented more efficiently
|
||||
void write( FileStorage& fs, const cv::String& name, const SparseMat& value )
|
||||
void write( FileStorage& fs, const String& name, const SparseMat& value )
|
||||
{
|
||||
Ptr<CvSparseMat> mat = (CvSparseMat*)value;
|
||||
cvWrite( *fs, name.size() ? name.c_str() : 0, mat );
|
||||
}
|
||||
|
||||
|
||||
WriteStructContext::WriteStructContext(FileStorage& _fs, const cv::String& name,
|
||||
int flags, const cv::String& typeName) : fs(&_fs)
|
||||
WriteStructContext::WriteStructContext(FileStorage& _fs, const String& name,
|
||||
int flags, const String& typeName) : fs(&_fs)
|
||||
{
|
||||
cvStartWriteStruct(**fs, !name.empty() ? name.c_str() : 0, flags,
|
||||
!typeName.empty() ? typeName.c_str() : 0);
|
||||
|
Reference in New Issue
Block a user