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
681e0323
Commit
681e0323
authored
5 years ago
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: backport toLowerCase()/toUpperCase()
parent
baf372ad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
cvstd.hpp
modules/core/include/opencv2/core/cvstd.hpp
+34
-0
No files found.
modules/core/include/opencv2/core/cvstd.hpp
View file @
681e0323
...
...
@@ -1026,6 +1026,40 @@ static inline bool operator>= (const String& lhs, const String& rhs) { return lh
static
inline
bool
operator
>=
(
const
char
*
lhs
,
const
String
&
rhs
)
{
return
rhs
.
compare
(
lhs
)
<=
0
;
}
static
inline
bool
operator
>=
(
const
String
&
lhs
,
const
char
*
rhs
)
{
return
lhs
.
compare
(
rhs
)
>=
0
;
}
#ifndef OPENCV_DISABLE_STRING_LOWER_UPPER_CONVERSIONS
//! @cond IGNORED
namespace
details
{
// std::tolower is int->int
static
inline
char
char_tolower
(
char
ch
)
{
return
(
char
)
std
::
tolower
((
int
)
ch
);
}
// std::toupper is int->int
static
inline
char
char_toupper
(
char
ch
)
{
return
(
char
)
std
::
toupper
((
int
)
ch
);
}
}
// namespace details
//! @endcond
static
inline
std
::
string
toLowerCase
(
const
std
::
string
&
str
)
{
std
::
string
result
(
str
);
std
::
transform
(
result
.
begin
(),
result
.
end
(),
result
.
begin
(),
details
::
char_tolower
);
return
result
;
}
static
inline
std
::
string
toUpperCase
(
const
std
::
string
&
str
)
{
std
::
string
result
(
str
);
std
::
transform
(
result
.
begin
(),
result
.
end
(),
result
.
begin
(),
details
::
char_toupper
);
return
result
;
}
#endif // OPENCV_DISABLE_STRING_LOWER_UPPER_CONVERSIONS
//! @} relates cv::String
}
// cv
...
...
This diff is collapsed.
Click to expand it.
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