MPD  0.20.6
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 
32 bool uri_has_scheme(const char *uri);
33 
38 std::string
39 uri_get_scheme(const char *uri);
40 
46 const char *
47 uri_get_path(const char *uri);
48 
50 const char *
51 uri_get_suffix(const char *uri);
52 
54  char data[8];
55 };
56 
61 const char *
62 uri_get_suffix(const char *uri, UriSuffixBuffer &buffer);
63 
73 bool
74 uri_safe_local(const char *uri);
75 
83 std::string
84 uri_remove_auth(const char *uri);
85 
92 bool
93 uri_is_child(const char *parent, const char *child);
94 
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
char data[8]
Definition: UriUtil.hxx:54
#define gcc_nonnull_all
Definition: Compiler.h:122
gcc_pure std::string uri_apply_base(const std::string &uri, const std::string &base)
Translate the given URI in the context of #base.
gcc_pure gcc_nonnull_all bool uri_is_child_or_same(const char *parent, const char *child)
gcc_pure bool uri_safe_local(const char *uri)
Returns true if this is a safe "local" URI:
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...
gcc_pure std::string uri_remove_auth(const char *uri)
Removes HTTP username and password from the URI.
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.
gcc_pure const char * uri_get_suffix(const char *uri)
#define gcc_pure
Definition: Compiler.h:116
gcc_pure std::string uri_get_scheme(const char *uri)
Returns the scheme name of the specified URI, or an empty string.
const Storage const char * uri
gcc_pure bool uri_has_scheme(const char *uri)
Checks whether the specified URI has a scheme in the form "scheme://".