Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
8a1f1fbe
Commit
8a1f1fbe
authored
Mar 13, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/ASCII: migrate to std::string_view
parent
45b60b3d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
CurlInputPlugin.cxx
src/input/plugins/CurlInputPlugin.cxx
+1
-0
ReplayGain.cxx
src/tag/ReplayGain.cxx
+1
-0
Table.cxx
src/tag/Table.cxx
+1
-0
ASCII.hxx
src/util/ASCII.hxx
+7
-5
No files found.
src/input/plugins/CurlInputPlugin.cxx
View file @
8a1f1fbe
...
...
@@ -36,6 +36,7 @@
#include "event/Loop.hxx"
#include "util/ASCII.hxx"
#include "util/StringFormat.hxx"
#include "util/StringView.hxx"
#include "util/NumberParser.hxx"
#include "util/Domain.hxx"
#include "Log.hxx"
...
...
src/tag/ReplayGain.cxx
View file @
8a1f1fbe
...
...
@@ -22,6 +22,7 @@
#include "ReplayGainInfo.hxx"
#include "util/ASCII.hxx"
#include "util/NumberParser.hxx"
#include "util/StringView.hxx"
#include <cassert>
...
...
src/tag/Table.cxx
View file @
8a1f1fbe
...
...
@@ -19,6 +19,7 @@
#include "Table.hxx"
#include "util/ASCII.hxx"
#include "util/StringView.hxx"
#include <string.h>
...
...
src/util/ASCII.hxx
View file @
8a1f1fbe
...
...
@@ -30,10 +30,10 @@
#ifndef ASCII_HXX
#define ASCII_HXX
#include "StringView.hxx"
#include "Compiler.h"
#include <cassert>
#include <string_view>
#include <strings.h>
...
...
@@ -73,17 +73,19 @@ StringEqualsCaseASCII(const char *a, const char *b, size_t n) noexcept
gcc_pure
gcc_nonnull_all
static
inline
bool
StringStartsWithCaseASCII
(
const
char
*
haystack
,
StringView
needle
)
noexcept
StringStartsWithCaseASCII
(
const
char
*
haystack
,
std
::
string_view
needle
)
noexcept
{
return
StringEqualsCaseASCII
(
haystack
,
needle
.
data
,
needle
.
size
);
return
StringEqualsCaseASCII
(
haystack
,
needle
.
data
(),
needle
.
length
()
);
}
gcc_pure
gcc_nonnull_all
static
inline
const
char
*
StringAfterPrefixCaseASCII
(
const
char
*
haystack
,
StringView
needle
)
noexcept
StringAfterPrefixCaseASCII
(
const
char
*
haystack
,
std
::
string_view
needle
)
noexcept
{
return
StringStartsWithCaseASCII
(
haystack
,
needle
)
?
haystack
+
needle
.
size
?
haystack
+
needle
.
length
()
:
nullptr
;
}
...
...
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