123456789101112131415161718192021222324252627282930313233 |
- #include <string>
- class BBS2chProxyURL {
- private:
- std::string _scheme;
- std::string _host;
- std::string _auth;
- std::string _pathAndOthers;
- int _port;
- bool _dirty;
- std::string _absoluteURLString;
- public:
- BBS2chProxyURL() : _port(0), _dirty(true) {};
- BBS2chProxyURL(const char *url);
- BBS2chProxyURL(const char *scheme, const char *host);
- BBS2chProxyURL(const char *scheme, const char *host, int port, const char *path);
- BBS2chProxyURL(const BBS2chProxyURL &baseURL, const char *path);
- const std::string& absoluteString();
- const std::string& getScheme() const;
- const std::string& getHost() const;
- const std::string& getPathAndOthers() const;
- void setScheme(const std::string &scheme);
- void setPort(int port);
- bool isHttp() const;
- bool isValid() const;
- bool equals(const BBS2chProxyURL &url, bool ignoreHttpOrHttps = false) const;
- bool isKindOfHost(const std::string &hostSuffix) const;
- bool replaceHost(const std::string &fromHost, const std::string &toHost);
- bool isFamilyOf5chNet() const;
- bool pathStartsWith(const std::string &prefix) const;
- bool hostStartsWith(const std::string &prefix) const;
- };
|