MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

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 uri_has_scheme(const char *uri);
33
37 gcc_pure
38 std::string
39 uri_get_scheme(const char *uri);
40
45 gcc_pure gcc_nonnull_all
46 const char *
47 uri_get_path(const char *uri);
48
49 gcc_pure
50 const char *
51 uri_get_suffix(const char *uri);
52
53 struct UriSuffixBuffer {
54 char data[8];
55 };
56
60 gcc_pure
61 const char *
62 uri_get_suffix(const char *uri, UriSuffixBuffer &buffer);
63
72 gcc_pure
73 bool
74 uri_safe_local(const char *uri);
75
82 gcc_pure
83 std::string
84 uri_remove_auth(const char *uri);
85
91 gcc_pure gcc_nonnull_all
92 bool
93 uri_is_child(const char *parent, const char *child);
94
95 gcc_pure gcc_nonnull_all
96 bool
97 uri_is_child_or_same(const char *parent, const char *child);
98
103 gcc_pure
104 std::string
105 uri_apply_base(const std::string &uri, const std::string &base);
106
107 #endif
UriSuffixBuffer::data
char data[8]
Definition: UriUtil.hxx:54
gcc_nonnull_all
#define gcc_nonnull_all
Definition: Compiler.h:122
uri_apply_base
gcc_pure std::string uri_apply_base(const std::string &uri, const std::string &base)
Translate the given URI in the context of #base.
uri_is_child_or_same
gcc_pure gcc_nonnull_all bool uri_is_child_or_same(const char *parent, const char *child)
uri_safe_local
gcc_pure bool uri_safe_local(const char *uri)
Returns true if this is a safe "local" URI:
Compiler.h
uri_get_path
gcc_pure gcc_nonnull_all const char * uri_get_path(const char *uri)
Returns the URI path (including the query string) or nullptr if the given URI has no path...
uri_remove_auth
gcc_pure std::string uri_remove_auth(const char *uri)
Removes HTTP username and password from the URI.
UriSuffixBuffer
Definition: UriUtil.hxx:53
uri_is_child
gcc_pure gcc_nonnull_all bool uri_is_child(const char *parent, const char *child)
Check whether #child specifies a resource "inside" the directory specified by #parent.
uri_get_suffix
gcc_pure const char * uri_get_suffix(const char *uri)
gcc_pure
#define gcc_pure
Definition: Compiler.h:116
uri_get_scheme
gcc_pure std::string uri_get_scheme(const char *uri)
Returns the scheme name of the specified URI, or an empty string.
uri
const Storage const char * uri
Definition: DatabasePlaylist.hxx:31
uri_has_scheme
gcc_pure bool uri_has_scheme(const char *uri)
Checks whether the specified URI has a scheme in the form "scheme://".