LibPkg
uri.h
Go to the documentation of this file.
1 // This file is part of LibPkg.
2 // Copyright © 2004-2005 Graham Shaw.
3 // Distribution and use are subject to the GNU Lesser General Public License,
4 // a copy of which may be found in the file !LibPkg.Copyright.
5 
6 #ifndef LIBPKG_URI
7 #define LIBPKG_URI
8 
9 #include <string>
10 
11 namespace pkg {
12 
13 using std::string;
14 
25 class uri
26 {
27 private:
32  string _scheme;
33 
38  string _authority;
39 
41  string _path;
42 
47  string _query;
48 
53  string _fragment;
54 public:
56  uri();
57 
59  explicit uri(const string& s);
60 
64  operator string();
65 
71  uri operator+(const uri& rel_uri);
72 
78  uri& operator+=(const uri& rel_uri);
79 
85  const string& scheme() const
86  { return _scheme; }
87 
93  const string& authority() const
94  { return _authority; }
95 
99  const string& path() const
100  { return _path; }
101 
107  const string& query() const
108  { return _query; }
109 
115  const string& fragment() const
116  { return _fragment; }
117 
124  uri& scheme(const string& scheme);
125 
132  uri& authority(const string& authority);
133 
138  uri& path(const string& path);
139 
146  uri& query(const string& query);
147 
154  uri& fragment(const string& fragment);
155 };
156 
157 }; /* namespace pkg */
158 
159 #endif
const string & scheme() const
Get scheme component.
Definition: uri.h:85
const string & path() const
Get path component.
Definition: uri.h:99
A class to represent a uniform resource identifier.
Definition: uri.h:25
const string & fragment() const
Get fragment component.
Definition: uri.h:115
uri & operator+=(const uri &rel_uri)
Resolve relative URI to produce absolute URI.
Definition: uri.cc:130
uri()
Construct empty URI.
const string & authority() const
Get authority component.
Definition: uri.h:93
uri operator+(const uri &rel_uri)
Resolve relative URI to produce absolute URI.
Definition: uri.cc:65
const string & query() const
Get query component.
Definition: uri.h:107

Reference Manual LibPkg Version 0.6.1 (28 Jan 2015)