Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
4fb4617d
Commit
4fb4617d
authored
Feb 07, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: Parameterize CharT
parent
ede0f6aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
src/util.h
src/util.h
+12
-9
No files found.
src/util.h
View file @
4fb4617d
...
...
@@ -217,8 +217,8 @@ bool istarts_with(InputIt a, size_t an, const char *b) {
bool
istarts_with
(
const
char
*
a
,
const
char
*
b
);
template
<
size_t
N
>
bool
istarts_with_l
(
const
std
::
string
&
a
,
const
char
(
&
b
)[
N
])
{
template
<
typename
CharT
,
size_t
N
>
bool
istarts_with_l
(
const
std
::
string
&
a
,
const
CharT
(
&
b
)[
N
])
{
return
istarts_with
(
std
::
begin
(
a
),
std
::
end
(
a
),
b
,
b
+
N
-
1
);
}
...
...
@@ -248,7 +248,8 @@ inline bool iends_with(const std::string &a, const std::string &b) {
return
iends_with
(
std
::
begin
(
a
),
std
::
end
(
a
),
std
::
begin
(
b
),
std
::
end
(
b
));
}
template
<
size_t
N
>
bool
iends_with_l
(
const
std
::
string
&
a
,
const
char
(
&
b
)[
N
])
{
template
<
typename
CharT
,
size_t
N
>
bool
iends_with_l
(
const
std
::
string
&
a
,
const
CharT
(
&
b
)[
N
])
{
return
iends_with
(
std
::
begin
(
a
),
std
::
end
(
a
),
b
,
b
+
N
-
1
);
}
...
...
@@ -291,12 +292,13 @@ inline bool strieq(const char *a, const std::string &b) {
return
strieq
(
a
,
b
.
c_str
(),
b
.
size
());
}
template
<
typename
InputIt
,
size_t
N
>
bool
strieq_l
(
const
char
(
&
a
)[
N
],
InputIt
b
,
size_t
blen
)
{
template
<
typename
CharT
,
typename
InputIt
,
size_t
N
>
bool
strieq_l
(
const
CharT
(
&
a
)[
N
],
InputIt
b
,
size_t
blen
)
{
return
strieq
(
a
,
N
-
1
,
b
,
blen
);
}
template
<
size_t
N
>
bool
strieq_l
(
const
char
(
&
a
)[
N
],
const
std
::
string
&
b
)
{
template
<
typename
CharT
,
size_t
N
>
bool
strieq_l
(
const
CharT
(
&
a
)[
N
],
const
std
::
string
&
b
)
{
return
strieq
(
a
,
N
-
1
,
std
::
begin
(
b
),
b
.
size
());
}
...
...
@@ -325,12 +327,13 @@ inline bool streq(const char *a, const char *b) {
return
streq
(
a
,
strlen
(
a
),
b
,
strlen
(
b
));
}
template
<
typename
InputIt
,
size_t
N
>
bool
streq_l
(
const
char
(
&
a
)[
N
],
InputIt
b
,
size_t
blen
)
{
template
<
typename
CharT
,
typename
InputIt
,
size_t
N
>
bool
streq_l
(
const
CharT
(
&
a
)[
N
],
InputIt
b
,
size_t
blen
)
{
return
streq
(
a
,
N
-
1
,
b
,
blen
);
}
template
<
size_t
N
>
bool
streq_l
(
const
char
(
&
a
)[
N
],
const
std
::
string
&
b
)
{
template
<
typename
CharT
,
size_t
N
>
bool
streq_l
(
const
CharT
(
&
a
)[
N
],
const
std
::
string
&
b
)
{
return
streq
(
a
,
N
-
1
,
std
::
begin
(
b
),
b
.
size
());
}
...
...
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