diff options
Diffstat (limited to 'googleurl')
-rw-r--r-- | googleurl/src/gurl.cc | 7 | ||||
-rw-r--r-- | googleurl/src/gurl.h | 2 | ||||
-rw-r--r-- | googleurl/src/url_parse.cc | 3 | ||||
-rw-r--r-- | googleurl/src/url_parse.h | 2 |
4 files changed, 13 insertions, 1 deletions
diff --git a/googleurl/src/gurl.cc b/googleurl/src/gurl.cc index a0bfd26..3a1f2b9 100644 --- a/googleurl/src/gurl.cc +++ b/googleurl/src/gurl.cc @@ -148,6 +148,13 @@ GURL::GURL(const char* canonical_spec, size_t canonical_spec_len, #endif } +GURL& GURL::operator=(const GURL& other) { + spec_ = other.spec_; + is_valid_ = other.is_valid_; + parsed_ = other.parsed_; + return *this; +} + const std::string& GURL::spec() const { if (is_valid_ || spec_.empty()) return spec_; diff --git a/googleurl/src/gurl.h b/googleurl/src/gurl.h index ba97191..4088f27 100644 --- a/googleurl/src/gurl.h +++ b/googleurl/src/gurl.h @@ -69,6 +69,8 @@ class GURL { GURL_API GURL(const char* canonical_spec, size_t canonical_spec_len, const url_parse::Parsed& parsed, bool is_valid); + GURL_API GURL& operator=(const GURL& other); + // Returns true when this object represents a valid parsed URL. When not // valid, other functions will still succeed, but you will not get canonical // data out in the format you may be expecting. Instead, we keep something diff --git a/googleurl/src/url_parse.cc b/googleurl/src/url_parse.cc index fa31210..28e7a0b 100644 --- a/googleurl/src/url_parse.cc +++ b/googleurl/src/url_parse.cc @@ -565,6 +565,9 @@ bool DoExtractQueryKeyValue(const CHAR* spec, } // namespace +Parsed::Parsed() { +} + int Parsed::Length() const { if (ref.is_valid()) return ref.end(); diff --git a/googleurl/src/url_parse.h b/googleurl/src/url_parse.h index 134b445..64bb223 100644 --- a/googleurl/src/url_parse.h +++ b/googleurl/src/url_parse.h @@ -120,7 +120,7 @@ struct Parsed { }; // The default constructor is sufficient for the components. - Parsed() {} + GURL_API Parsed(); // Returns the length of the URL (the end of the last component). // |