21 #ifndef LUNCHBOX_URI_H
22 #define LUNCHBOX_URI_H
26 #include <boost/unordered_map.hpp>
30 namespace detail {
class URI; }
58 typedef boost::unordered_map< std::string, std::string > KVMap;
59 typedef KVMap::const_iterator ConstKVIter;
67 LUNCHBOX_API
URI(
const std::string& uri );
70 LUNCHBOX_API
URI(
const URI& from );
75 LUNCHBOX_API URI&
operator = (
const URI& rhs );
79 LUNCHBOX_API
const std::string& getScheme()
const;
80 LUNCHBOX_API
const std::string& getUserinfo()
const;
81 LUNCHBOX_API uint16_t getPort()
const;
82 LUNCHBOX_API
const std::string& getHost()
const;
83 LUNCHBOX_API
const std::string& getPath()
const;
84 LUNCHBOX_API
const std::string& getQuery()
const;
85 LUNCHBOX_API
const std::string& getFragment()
const;
100 LUNCHBOX_API ConstKVIter
queryEnd()
const;
106 LUNCHBOX_API ConstKVIter
findQuery(
const std::string& key )
const;
110 detail::URI*
const _impl;
113 inline std::ostream&
operator << ( std::ostream& os,
const URI& uri )
115 os << uri.getScheme() <<
"://";
116 if( !uri.getUserinfo().empty( ))
117 os << uri.getUserinfo() <<
"@";
120 os <<
':' << uri.getPort();
121 os << uri.getPath() <<
'?' << uri.getQuery();
122 if( !uri.getFragment().empty( ))
123 os <<
'#' << uri.getFragment();
128 #endif // LUNCHBOX_URI_H
Defines export visibility macros for Lunchbox.
Basic type definitions not provided by the operating system.
LUNCHBOX_API URI & operator=(const URI &rhs)
Assign the data from another URI.
LUNCHBOX_API URI(const std::string &uri)
LUNCHBOX_API ConstKVIter queryBegin() const
The URI class parses the given uri string according to the regex given in RFC3986.
LUNCHBOX_API ConstKVIter queryEnd() const
LUNCHBOX_API ConstKVIter findQuery(const std::string &key) const
std::ostream & operator<<(std::ostream &os, const Array< T > &array)
Pretty-print all members of the array.