#pragma once
#define FOLLY_URI_H_
-#include <folly/String.h>
+#include <string>
#include <vector>
+#include <folly/String.h>
+
namespace folly {
/**
*/
explicit Uri(StringPiece str);
- const fbstring& scheme() const { return scheme_; }
- const fbstring& username() const { return username_; }
- const fbstring& password() const { return password_; }
+ const std::string& scheme() const { return scheme_; }
+ const std::string& username() const { return username_; }
+ const std::string& password() const { return password_; }
/**
* Get host part of URI. If host is an IPv6 address, square brackets will be
* returned, for example: "[::1]".
*/
- const fbstring& host() const { return host_; }
+ const std::string& host() const { return host_; }
/**
* Get host part of URI. If host is an IPv6 address, square brackets will not
* be returned, for exmaple "::1"; otherwise it returns the same thing as
* or API that connects to that host/port; e.g. getaddrinfo() only understands
* IPv6 host without square brackets
*/
- fbstring hostname() const;
+ std::string hostname() const;
uint16_t port() const { return port_; }
- const fbstring& path() const { return path_; }
- const fbstring& query() const { return query_; }
- const fbstring& fragment() const { return fragment_; }
+ const std::string& path() const { return path_; }
+ const std::string& query() const { return query_; }
+ const std::string& fragment() const { return fragment_; }
- fbstring authority() const;
+ std::string authority() const;
template <class String>
String toString() const;
* pair of which the first element is parameter name and the second
* one is parameter value
*/
- const std::vector<std::pair<fbstring, fbstring>>& getQueryParams();
+ const std::vector<std::pair<std::string, std::string>>& getQueryParams();
private:
- fbstring scheme_;
- fbstring username_;
- fbstring password_;
- fbstring host_;
+ std::string scheme_;
+ std::string username_;
+ std::string password_;
+ std::string host_;
bool hasAuthority_;
uint16_t port_;
- fbstring path_;
- fbstring query_;
- fbstring fragment_;
- std::vector<std::pair<fbstring, fbstring>> queryParams_;
+ std::string path_;
+ std::string query_;
+ std::string fragment_;
+ std::vector<std::pair<std::string, std::string>> queryParams_;
};
-} // namespace folly
+} // namespace folly
#include <folly/Uri-inl.h>