MPD: util/UriUtil.hxx Source File

MPD 0.20.15

UriUtil.hxx
Go to the documentation of this file.
1 /*
2 * Copyright 2003-2017 The Music Player Daemon Project
3 * http://www.musicpd.org
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #ifndef MPD_URI_UTIL_HXX
21 #define MPD_URI_UTIL_HXX
22
23 #include "Compiler.h"
24
25 #include <string>
26
31 gcc_pure
32 bool
33 uri_has_scheme(const char *uri) noexcept;
34
38 gcc_pure
39 std::string
40 uri_get_scheme(const char *uri) noexcept;
41
46 gcc_pure gcc_nonnull_all
47 const char *
48 uri_get_path(const char *uri) noexcept;
49
50 gcc_pure
51 const char *
52 uri_get_suffix(const char *uri) noexcept;
53
54 struct UriSuffixBuffer {
55 char data[8];
56 };
57
61 gcc_pure
62 const char *
63 uri_get_suffix(const char *uri, UriSuffixBuffer &buffer) noexcept;
64
73 gcc_pure
74 bool
75 uri_safe_local(const char *uri) noexcept;
76
83 gcc_pure
84 std::string
85 uri_remove_auth(const char *uri) noexcept;
86
92 gcc_pure gcc_nonnull_all
93 bool
94 uri_is_child(const char *parent, const char *child) noexcept;
95
96 gcc_pure gcc_nonnull_all
97 bool
98 uri_is_child_or_same(const char *parent, const char *child) noexcept;
99
104 gcc_pure
105 std::string
106 uri_apply_base(const std::string &uri, const std::string &base) noexcept;
107
108 #endif
uri_get_path
gcc_pure gcc_nonnull_all const char * uri_get_path(const char *uri) noexcept
Returns the URI path (including the query string) or nullptr if the given URI has no path...
UriSuffixBuffer::data
char data[8]
Definition: UriUtil.hxx:55
gcc_nonnull_all
#define gcc_nonnull_all
Definition: Compiler.h:122
uri_has_scheme
gcc_pure bool uri_has_scheme(const char *uri) noexcept
Checks whether the specified URI has a scheme in the form "scheme://".
uri_safe_local
gcc_pure bool uri_safe_local(const char *uri) noexcept
Returns true if this is a safe "local" URI:
uri_get_suffix
gcc_pure const char * uri_get_suffix(const char *uri) noexcept
Compiler.h
uri_apply_base
gcc_pure std::string uri_apply_base(const std::string &uri, const std::string &base) noexcept
Translate the given URI in the context of #base.
uri_is_child
gcc_pure gcc_nonnull_all bool uri_is_child(const char *parent, const char *child) noexcept
Check whether #child specifies a resource "inside" the directory specified by #parent.
uri_is_child_or_same
gcc_pure gcc_nonnull_all bool uri_is_child_or_same(const char *parent, const char *child) noexcept
UriSuffixBuffer
Definition: UriUtil.hxx:54
uri_remove_auth
gcc_pure std::string uri_remove_auth(const char *uri) noexcept
Removes HTTP username and password from the URI.
gcc_pure
#define gcc_pure
Definition: Compiler.h:116
uri_get_scheme
gcc_pure std::string uri_get_scheme(const char *uri) noexcept
Returns the scheme name of the specified URI, or an empty string.
uri
const Storage const char * uri
Definition: DatabasePlaylist.hxx:31