- Added asCompleteString() shortcut function that forces
authorMarius Tomaschewski <mt@suse.de>
Tue, 7 Mar 2006 16:41:46 +0000 (16:41 +0000)
committerMarius Tomaschewski <mt@suse.de>
Tue, 7 Mar 2006 16:41:46 +0000 (16:41 +0000)
  returning of all URL components (incl. password)

zypp/Url.cc
zypp/Url.h

index 0f35ccdd1dd32c47074e49cba327ad3940c0a6b0..8398c33e8b32fbb0976bbc1d5a966a189202427d 100644 (file)
@@ -426,6 +426,26 @@ namespace zypp
   }
 
 
+  // -----------------------------------------------------------------
+  std::string
+  Url::asCompleteString() const
+  {
+    // make sure, all url components are included;
+    // regardless of the current configuration...
+    ViewOptions opts(getViewOptions() +
+                     ViewOption::WITH_SCHEME +
+                     ViewOption::WITH_USERNAME +
+                     ViewOption::WITH_PASSWORD +
+                     ViewOption::WITH_HOST +
+                     ViewOption::WITH_PORT +
+                     ViewOption::WITH_PATH_NAME +
+                     ViewOption::WITH_PATH_PARAMS +
+                     ViewOption::WITH_QUERY_STR +
+                     ViewOption::WITH_FRAGMENT);
+    return m_impl->asString(opts);
+  }
+
+
   // -----------------------------------------------------------------
   std::string
   Url::asString(const ViewOptions &opts) const
index 9142a50837df475e7208de3f06b7498e802c4b88..3002681acca9913be1efeb2ebb1e4c4bd81933d6 100644 (file)
@@ -286,6 +286,18 @@ namespace zypp
     std::string
     asString(const ViewOptions &opts) const;
 
+    /**
+     * Returns a complete string representation of the Url object.
+     *
+     * This function ignores the configuration of the view options
+     * in the current object (see setViewOption()) and forces to
+     * return an string with all URL components included.
+     *
+     * \return A complete string representation of the Url object.
+     */
+    std::string
+    asCompleteString() const;
+
 
     // -----------------
     /**