Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
ae8dcdf4
Commit
ae8dcdf4
authored
May 19, 2017
by
Vladislav Sovrasov
Committed by
Alexander Alekhin
Aug 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: get rid of built-in String type
parent
ee1e1ce3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
6 additions
and
103 deletions
+6
-103
cvstd.hpp
modules/core/include/opencv2/core/cvstd.hpp
+0
-0
cvstd.inl.hpp
modules/core/include/opencv2/core/cvstd.inl.hpp
+0
-63
persistence.hpp
modules/core/include/opencv2/core/persistence.hpp
+0
-3
utility.hpp
modules/core/include/opencv2/core/utility.hpp
+0
-9
stl.cpp
modules/core/src/stl.cpp
+0
-24
system.cpp
modules/core/src/system.cpp
+3
-1
NCVHaarObjectDetection.cu
modules/cudalegacy/src/cuda/NCVHaarObjectDetection.cu
+2
-2
cascadeclassifier.cpp
modules/cudaobjdetect/src/cascadeclassifier.cpp
+1
-1
No files found.
modules/core/include/opencv2/core/cvstd.hpp
View file @
ae8dcdf4
This diff is collapsed.
Click to expand it.
modules/core/include/opencv2/core/cvstd.inl.hpp
View file @
ae8dcdf4
...
...
@@ -73,69 +73,6 @@ public:
typedef
Vec
<
channel_type
,
channels
>
vec_type
;
};
inline
String
::
String
(
const
std
::
string
&
str
)
:
cstr_
(
0
),
len_
(
0
)
{
size_t
len
=
str
.
size
();
if
(
len
)
memcpy
(
allocate
(
len
),
str
.
c_str
(),
len
);
}
inline
String
::
String
(
const
std
::
string
&
str
,
size_t
pos
,
size_t
len
)
:
cstr_
(
0
),
len_
(
0
)
{
size_t
strlen
=
str
.
size
();
pos
=
min
(
pos
,
strlen
);
len
=
min
(
strlen
-
pos
,
len
);
if
(
!
len
)
return
;
memcpy
(
allocate
(
len
),
str
.
c_str
()
+
pos
,
len
);
}
inline
String
&
String
::
operator
=
(
const
std
::
string
&
str
)
{
deallocate
();
size_t
len
=
str
.
size
();
if
(
len
)
memcpy
(
allocate
(
len
),
str
.
c_str
(),
len
);
return
*
this
;
}
inline
String
&
String
::
operator
+=
(
const
std
::
string
&
str
)
{
*
this
=
*
this
+
str
;
return
*
this
;
}
inline
String
::
operator
std
::
string
()
const
{
return
std
::
string
(
cstr_
,
len_
);
}
inline
String
operator
+
(
const
String
&
lhs
,
const
std
::
string
&
rhs
)
{
String
s
;
size_t
rhslen
=
rhs
.
size
();
s
.
allocate
(
lhs
.
len_
+
rhslen
);
if
(
lhs
.
len_
)
memcpy
(
s
.
cstr_
,
lhs
.
cstr_
,
lhs
.
len_
);
if
(
rhslen
)
memcpy
(
s
.
cstr_
+
lhs
.
len_
,
rhs
.
c_str
(),
rhslen
);
return
s
;
}
inline
String
operator
+
(
const
std
::
string
&
lhs
,
const
String
&
rhs
)
{
String
s
;
size_t
lhslen
=
lhs
.
size
();
s
.
allocate
(
lhslen
+
rhs
.
len_
);
if
(
lhslen
)
memcpy
(
s
.
cstr_
,
lhs
.
c_str
(),
lhslen
);
if
(
rhs
.
len_
)
memcpy
(
s
.
cstr_
+
lhslen
,
rhs
.
cstr_
,
rhs
.
len_
);
return
s
;
}
inline
FileNode
::
operator
std
::
string
()
const
{
...
...
modules/core/include/opencv2/core/persistence.hpp
View file @
ae8dcdf4
...
...
@@ -576,7 +576,6 @@ public:
//! returns the node content as double
operator
double
()
const
;
//! returns the node content as text string
operator
String
()
const
;
operator
std
::
string
()
const
;
//! returns pointer to the underlying file node
...
...
@@ -1334,7 +1333,6 @@ inline const CvFileNode* FileNode::operator* () const { return node; }
inline
FileNode
::
operator
int
()
const
{
int
value
;
read
(
*
this
,
value
,
0
);
return
value
;
}
inline
FileNode
::
operator
float
()
const
{
float
value
;
read
(
*
this
,
value
,
0.
f
);
return
value
;
}
inline
FileNode
::
operator
double
()
const
{
double
value
;
read
(
*
this
,
value
,
0.
);
return
value
;
}
inline
FileNode
::
operator
String
()
const
{
String
value
;
read
(
*
this
,
value
,
value
);
return
value
;
}
inline
double
FileNode
::
real
()
const
{
return
double
(
*
this
);
}
inline
String
FileNode
::
string
()
const
{
return
String
(
*
this
);
}
inline
Mat
FileNode
::
mat
()
const
{
Mat
value
;
read
(
*
this
,
value
,
value
);
return
value
;
}
...
...
@@ -1343,7 +1341,6 @@ inline FileNodeIterator FileNode::end() const { return FileNodeIterator(fs, no
inline
void
FileNode
::
readRaw
(
const
String
&
fmt
,
uchar
*
vec
,
size_t
len
)
const
{
begin
().
readRaw
(
fmt
,
vec
,
len
);
}
inline
FileNode
FileNodeIterator
::
operator
*
()
const
{
return
FileNode
(
fs
,
(
const
CvFileNode
*
)(
const
void
*
)
reader
.
ptr
);
}
inline
FileNode
FileNodeIterator
::
operator
->
()
const
{
return
FileNode
(
fs
,
(
const
CvFileNode
*
)(
const
void
*
)
reader
.
ptr
);
}
inline
String
::
String
(
const
FileNode
&
fn
)
:
cstr_
(
0
),
len_
(
0
)
{
read
(
fn
,
*
this
,
*
this
);
}
//! @endcond
...
...
modules/core/include/opencv2/core/utility.hpp
View file @
ae8dcdf4
...
...
@@ -1053,15 +1053,6 @@ template<typename _Tp, size_t fixed_size> inline size_t
AutoBuffer
<
_Tp
,
fixed_size
>::
size
()
const
{
return
sz
;
}
template
<>
inline
std
::
string
CommandLineParser
::
get
<
std
::
string
>
(
int
index
,
bool
space_delete
)
const
{
return
get
<
String
>
(
index
,
space_delete
);
}
template
<>
inline
std
::
string
CommandLineParser
::
get
<
std
::
string
>
(
const
String
&
name
,
bool
space_delete
)
const
{
return
get
<
String
>
(
name
,
space_delete
);
}
//! @endcond
...
...
modules/core/src/stl.cpp
View file @
ae8dcdf4
...
...
@@ -43,27 +43,3 @@
#include "precomp.hpp"
char
*
cv
::
String
::
allocate
(
size_t
len
)
{
size_t
totalsize
=
alignSize
(
len
+
1
,
(
int
)
sizeof
(
int
));
int
*
data
=
(
int
*
)
cv
::
fastMalloc
(
totalsize
+
sizeof
(
int
));
data
[
0
]
=
1
;
cstr_
=
(
char
*
)(
data
+
1
);
len_
=
len
;
cstr_
[
len
]
=
0
;
return
cstr_
;
}
void
cv
::
String
::
deallocate
()
{
int
*
data
=
(
int
*
)
cstr_
;
len_
=
0
;
cstr_
=
0
;
if
(
data
&&
1
==
CV_XADD
(
data
-
1
,
-
1
))
{
cv
::
fastFree
(
data
-
1
);
}
}
modules/core/src/system.cpp
View file @
ae8dcdf4
...
...
@@ -1953,7 +1953,9 @@ public:
ippFeatures
=
cpuFeatures
;
const
char
*
pIppEnv
=
getenv
(
"OPENCV_IPP"
);
cv
::
String
env
=
pIppEnv
;
cv
::
String
env
;
if
(
pIppEnv
!=
NULL
)
env
=
pIppEnv
;
if
(
env
.
size
())
{
#if IPP_VERSION_X100 >= 201703
...
...
modules/cudalegacy/src/cuda/NCVHaarObjectDetection.cu
View file @
ae8dcdf4
...
...
@@ -2388,7 +2388,7 @@ NCVStatus ncvHaarGetClassifierSize(const cv::String &filename, Ncv32u &numStages
NCVStatus ncvStat;
cv::String fext = filename.substr(filename.find_last_of(".") + 1);
fext = fext.toLowerCase(
);
std::transform(fext.begin(), fext.end(), fext.begin(), ::tolower
);
if (fext == "nvbin")
{
...
...
@@ -2446,7 +2446,7 @@ NCVStatus ncvHaarLoadFromFile_host(const cv::String &filename,
NCVStatus ncvStat;
cv::String fext = filename.substr(filename.find_last_of(".") + 1);
fext = fext.toLowerCase(
);
std::transform(fext.begin(), fext.end(), fext.begin(), ::tolower
);
std::vector<HaarStage64> haarStages;
std::vector<HaarClassifierNode128> haarNodes;
...
...
modules/cudaobjdetect/src/cascadeclassifier.cpp
View file @
ae8dcdf4
...
...
@@ -809,7 +809,7 @@ namespace
Ptr
<
cuda
::
CascadeClassifier
>
cv
::
cuda
::
CascadeClassifier
::
create
(
const
String
&
filename
)
{
String
fext
=
filename
.
substr
(
filename
.
find_last_of
(
"."
)
+
1
);
fext
=
fext
.
toLowerCase
(
);
std
::
transform
(
fext
.
begin
(),
fext
.
end
(),
fext
.
begin
(),
::
tolower
);
if
(
fext
==
"nvbin"
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment