瀏覽代碼

mv some code from header file to source file

ithewei 2 年之前
父節點
當前提交
7f11480996
共有 2 個文件被更改,包括 13 次插入11 次删除
  1. 12 0
      cpputil/hurl.cpp
  2. 1 11
      cpputil/hurl.h

+ 12 - 0
cpputil/hurl.cpp

@@ -88,6 +88,18 @@ std::string HUrl::unescape(const std::string& str) {
     return ostr;
 }
 
+void HUrl::reset() {
+    url.clear();
+    scheme.clear();
+    username.clear();
+    password.clear();
+    host.clear();
+    port = 0;
+    path.clear();
+    query.clear();
+    fragment.clear();
+}
+
 bool HUrl::parse(const std::string& url) {
     reset();
     this->url = url;

+ 1 - 11
cpputil/hurl.h

@@ -16,19 +16,9 @@ public:
     HUrl() : port(0) {}
     ~HUrl() {}
 
+    void reset();
     bool parse(const std::string& url);
     const std::string& dump();
-    void reset() {
-        url.clear();
-        scheme.clear();
-        username.clear();
-        password.clear();
-        host.clear();
-        port = 0;
-        path.clear();
-        query.clear();
-        fragment.clear();
-    }
 
     std::string url;
     std::string scheme;