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
e4612ecb
Commit
e4612ecb
authored
Aug 09, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/UriExtract: add uri_get_fragment()
parent
9c685021
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
UriExtract.cxx
src/util/UriExtract.cxx
+10
-0
UriExtract.hxx
src/util/UriExtract.hxx
+10
-0
No files found.
src/util/UriExtract.cxx
View file @
e4612ecb
...
@@ -138,3 +138,13 @@ uri_get_suffix(const char *uri, UriSuffixBuffer &buffer) noexcept
...
@@ -138,3 +138,13 @@ uri_get_suffix(const char *uri, UriSuffixBuffer &buffer) noexcept
return
suffix
;
return
suffix
;
}
}
const
char
*
uri_get_fragment
(
const
char
*
uri
)
noexcept
{
const
char
*
fragment
=
strchr
(
uri
,
'#'
);
if
(
fragment
==
nullptr
)
return
nullptr
;
return
fragment
+
1
;
}
src/util/UriExtract.hxx
View file @
e4612ecb
...
@@ -72,4 +72,14 @@ gcc_pure
...
@@ -72,4 +72,14 @@ gcc_pure
const
char
*
const
char
*
uri_get_suffix
(
const
char
*
uri
,
UriSuffixBuffer
&
buffer
)
noexcept
;
uri_get_suffix
(
const
char
*
uri
,
UriSuffixBuffer
&
buffer
)
noexcept
;
/**
* Returns the URI fragment, i.e. the portion after the '#', but
* without the '#'. If there is no '#', this function returns
* nullptr; if there is a '#' but no fragment text, it returns an
* empty StringView.
*/
gcc_pure
gcc_nonnull_all
const
char
*
uri_get_fragment
(
const
char
*
uri
)
noexcept
;
#endif
#endif
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