1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
10 * \file zypp/url/UrlBase.h
12 #ifndef ZYPP_URL_URLBASE_H
13 #define ZYPP_URL_URLBASE_H
15 #include <zypp/url/UrlUtils.h>
16 #include <zypp/base/PtrTypes.h>
19 //////////////////////////////////////////////////////////////////////
21 { ////////////////////////////////////////////////////////////////////
23 ////////////////////////////////////////////////////////////////////
25 { //////////////////////////////////////////////////////////////////
28 // ---------------------------------------------------------------
30 * Url::asString() view options.
32 * A instance of this class represents a bit-wise combination
33 * of view option constants.
35 * It provides ViewOption::operator+() and ViewOption::operator-()
36 * to modify a view option combination and a ViewOption::has()
37 * method, to check if a specified option is enabled or not.
43 * Option to include scheme name in the URL string.
45 * Disabling this option causes, that the URL string
46 * contains the path, query and fragment components
47 * only, for example just "/foo/bar.txt".
49 * This option is \b enabled by default.
51 static const ViewOption WITH_SCHEME;
53 * Option to include username in the URL string.
55 * This option depends on a enabled WITH_SCHEME and
56 * WITH_HOST options and is \b enabled by default.
58 static const ViewOption WITH_USERNAME;
60 * Option to include password in the URL string.
62 * This option depends on a enabled WITH_SCHEME,
63 * WITH_HOST and WITH_USERNAME options and is
64 * \b disabled by default, causing to hide the
65 * password in the URL authority.
67 static const ViewOption WITH_PASSWORD;
69 * Option to include hostname in the URL string.
71 * This option depends on a enabled WITH_SCHEME
72 * option and is \b enabled by default.
74 static const ViewOption WITH_HOST;
76 * Option to include port number in the URL string.
78 * This option depends on a enabled WITH_SCHEME and
79 * WITH_HOST options and is \b enabled by default.
81 static const ViewOption WITH_PORT;
83 * Option to include path name in the URL string.
85 * This option is \b enabled by default.
87 static const ViewOption WITH_PATH_NAME;
89 * Option to include path parameters in the URL string.
91 * This option depends on a enabled WITH_PATH_NAME
92 * option and is \b disabled by default, causing to
93 * hide the path parameters.
95 static const ViewOption WITH_PATH_PARAMS;
97 * Option to include query string in the URL string.
99 * This option is \b enabled by default.
101 static const ViewOption WITH_QUERY_STR;
103 * Option to include fragment string in the URL string.
105 * This option is \b enabled by default.
107 static const ViewOption WITH_FRAGMENT;
112 * Explicitely include the URL authority separator "//".
114 * It causes, that the URL string includes an empty URL
115 * authority, for example:
116 * "file:///foo.txt" instead of just "file:/foo.txt".
118 * This option depends on a enabled WITH_SCHEME view
119 * option and is enabled by default.
121 static const ViewOption EMPTY_AUTHORITY;
123 * Explicitely include the "/" path character.
125 * It causes, that a "/" is added to the Url if the path
126 * name is empty, for example:
128 * "http://localhost/" instead of just "http://localhost".
130 * This option depends on a enabled WITH_PATH_NAME view
131 * option and is enabled by default.
133 static const ViewOption EMPTY_PATH_NAME;
135 * Explicitely include the path parameters separator ";".
137 * It causes, that the URL allways contains the ";" path
138 * parameters separator.
140 * This option depends on a enabled EMPTY_PATH_NAME view
141 * option and is disabled by default.
143 static const ViewOption EMPTY_PATH_PARAMS;
145 * Explicitely include the query string separator "?".
147 * It causes, that if the query string is requested using
148 * the WITH_QUERY_STR option, the URL allways contains the
149 * "?" query string separator, even if the query string is
151 * This option depends on a enabled WITH_QUERY_STR view
152 * option and is disabled by default.
154 static const ViewOption EMPTY_QUERY_STR;
156 * Explicitely include the fragment string separator "#".
158 * It causes, that if the fragment string is requested using
159 * the WITH_FRAGMENT option, the URL allways contains the "#"
160 * fragment string separator, even if the fragment string is
162 * This option depends on a enabled WITH_FRAGMENT view
163 * option and is disabled by default.
165 static const ViewOption EMPTY_FRAGMENT;
170 * Default combination of view options.
172 * By default, following view options are enabled:
173 * WITH_SCHEME, WITH_USERNAME, WITH_HOST,
174 * WITH_PORT, WITH_PATH_NAME, WITH_QUERY_STR,
175 * WITH_FRAGMENT, EMPTY_AUTHORITY, EMPTY_PATH_NAME.
177 static const ViewOption DEFAULTS;
182 * Create instance with default combination of view options.
188 * Adds \p l and \p r to a new option combination.
190 * @return The new option combination.
192 friend inline ViewOption
193 operator + (const ViewOption &l, const ViewOption &r)
195 return ViewOption(l.opt | r.opt);
199 * Substract \p r from \p l to a new option combination.
201 * @return The new option combination.
203 friend inline ViewOption
204 operator - (const ViewOption &l, const ViewOption &r)
206 return ViewOption(l.opt & ~r.opt);
210 * Assign specified option combination \p o to the current object.
212 * \param o The option or option combination to make a copy of.
213 * \return A reference to this option combination.
216 operator = (const ViewOption &o)
218 opt = o.opt; return *this;
222 * Check if specified option \p o is set in the current object.
223 * \param o A view option constant.
224 * \return True, if specified option \p o is
225 * set/enabled in the instance.
228 has(const ViewOption &o) const
233 static const ViewOption hotfix1050625;
235 ViewOption(int option);
240 // ---------------------------------------------------------------
242 * ViewOptions is just an alias for ViewOption.
244 typedef ViewOption ViewOptions;
247 // ---------------------------------------------------------------
249 * Vector of URL scheme names.
251 typedef std::vector<std::string> UrlSchemes;
254 // ---------------------------------------------------------------
256 * Forward declaration of internal UrlBase data.
261 // ---------------------------------------------------------------
263 * \brief Generic Url base class.
265 * The UrlBase class implements default behaviour for URL
266 * manipulations and a base for implementation of scheme-
267 * specialized URLs for the Url class.
280 * Create a new Url object as copy of the given one.
281 * \param url The Url object to make a copy of.
283 UrlBase(const UrlBase &url);
286 * \brief Construct new object and initializes it with
287 * specified URL components.
289 * \param scheme The scheme name.
290 * \param authority The encoded authority component data.
291 * \param pathdata The encoded path component data.
292 * \param querystr The encoded query string component.
293 * \param fragment The encoded fragment string component.
294 * \throws UrlNotAllowedException if one of the components
295 * is not allowed for the scheme.
296 * \throws UrlBadComponentException if one of the components
297 * contains an invalid character.
299 UrlBase(const std::string &scheme,
300 const std::string &authority,
301 const std::string &pathdata,
302 const std::string &querystr,
303 const std::string &fragment);
308 * \brief Clears all data in the object.
314 * Returns pointer to a copy of the current object.
316 * Should be reimplemented by all derived object using
317 * the copy constructor of the derived class, e.g.:
319 * return new MyUrlDerivedFromUrlBase(*this);
322 * \return A pointer to a copy of the current object.
328 * \brief Initializes current object with new URL components.
330 * \param scheme The scheme name.
331 * \param authority The encoded authority component data.
332 * \param pathdata The encoded path component data.
333 * \param querystr The encoded query string component.
334 * \param fragment The encoded fragment string component.
335 * \throws UrlNotAllowedException if one of the components
336 * is not allowed in the scheme.
337 * \throws UrlBadComponentException if one of the components
338 * contains an invalid character.
341 init(const std::string &scheme,
342 const std::string &authority,
343 const std::string &pathdata,
344 const std::string &querystr,
345 const std::string &fragment);
350 * \brief Returns scheme names known by this object.
352 * This method is used in the isValidScheme() method and
353 * is intended to be reimplemented by derived classes to
354 * return the scheme names it implements (is restricted
357 * For example, if your derived class implements special
358 * features of LDAP URLs, this method may return "ldap"
359 * and "ldaps" scheme names.
361 * The UrlBase class returns an empty vector, that signals
362 * that it is useable with all URLs.
364 * \return A vector with scheme names known by this object.
367 getKnownSchemes() const;
370 * \brief Returns if scheme name is known to this object.
371 * \return True, if scheme name is known to this object.
374 isKnownScheme(const std::string &scheme) const;
378 * \brief Verifies specified scheme name.
380 * Verifies the generic syntax of the specified \p scheme name
381 * and if it is contained in the current object's list of known
382 * schemes (see getKnownSchemes()) if the list is not empty (as
383 * in the UrlBase class).
385 * \param scheme The scheme name to verify.
386 * \return True, if generic scheme name syntax is valid and
387 * the scheme name is known to the current object.
390 isValidScheme(const std::string &scheme) const;
393 * \brief Verifies the Url.
395 * Verifies if the current object contains a non-empty scheme
396 * name. Additional semantical URL checks may be performed by
397 * derived UrlBase-objects.
399 * \return True, if the Url seems to be valid.
407 * Returns a default string representation of the Url object.
409 * By default, a password in the URL will be hidden.
411 * \return A default string representation of the Url object.
417 * Returns a string representation of the Url object.
419 * To include a password in the resulting Url string, use:
421 * url.asString(url.getViewOptions() +
422 * url::ViewOptions::WITH_PASSWORD);
425 * \param opts A combination of view options.
426 * \return A string representation of the Url object.
429 asString(const zypp::url::ViewOptions &opts) const;
434 * Returns the scheme name of the URL.
435 * \return Scheme name of the current Url object.
443 * Returns the encoded authority component of the URL.
445 * The returned authority string does not contain the leading
446 * "//" separator characters, but just its "user:pass@host:port"
449 * \return The encoded authority component string.
452 getAuthority() const;
455 * Returns the username from the URL authority.
456 * \param eflag Flag if the usename should be percent-decoded or not.
457 * \return The username sub-component from the URL authority.
458 * \throws UrlDecodingException if the decoded result string
459 * would contain a '\\0' character.
462 getUsername(EEncoding eflag) const;
465 * Returns the password from the URL authority.
466 * \param eflag Flag if the password should be percent-decoded or not.
467 * \return The password sub-component from the URL authority.
468 * \throws UrlDecodingException if the decoded result string
469 * would contain a '\\0' character.
472 getPassword(EEncoding eflag) const;
475 * Returns the hostname or IP from the URL authority.
477 * In case the Url contains an IPv6 number, it is be surrounded
478 * by "[" and "]" characters, for example "[::1]" for an IPv6
481 * \param eflag Flag if the host should be percent-decoded or not.
482 * \return The host sub-component from the URL authority.
483 * \throws UrlDecodingException if the decoded result string
484 * would contain a '\\0' character.
487 getHost(EEncoding eflag) const;
490 * Returns the port number from the URL authority.
491 * \return The port sub-component from the URL authority.
499 * Returns the encoded path component of the URL.
501 * The path data contains the path name, optionally
502 * followed by path parameters separated with a ";"
503 * character, for example "/foo/bar;version=1.1".
505 * \return The encoded path component of the URL.
511 * Returns the path name from the URL.
512 * \param eflag Flag if the path should be decoded or not.
513 * \return The path name sub-component without path parameters
514 * from path data component of the URL.
515 * \throws UrlDecodingException if the decoded result string
516 * would contain a '\\0' character.
519 getPathName(EEncoding eflag) const;
522 * Returns the encoded path parameters from the URL.
523 * \return The encoded path parameters from the URL.
526 getPathParams() const;
529 * Returns a vector with encoded path parameter substrings.
531 * The default path parameter separator is the \c ',' character.
532 * A schema specific object may overide the default separators.
534 * For example, the path parameters string "foo=1,bar=2" is splited
535 * by default into a vector containing the substrings "foo=1" and
538 * \return The encoded path parameters vector.
540 virtual zypp::url::ParamVec
541 getPathParamsVec() const;
544 * Returns a string map with path parameter keys and values.
546 * The default path parameter separator is the \c ',' character,
547 * the default key/value separator for the path parameters is
548 * the \c '=' character.
549 * A schema specific object may overide the default separators.
551 * For example, the path parameters string "foo=1,bar=2" is splited
552 * into a map containing "foo" = "1" and "bar" = "2" by default.
554 * \param eflag Flag if the path parameter keys and values should
556 * \return The path parameters key and values as a string map.
557 * \throws UrlNotSupportedException if parameter parsing
558 * is not supported for a URL (scheme).
559 * \throws UrlDecodingException if the decoded result string
560 * would contain a '\\0' character.
562 virtual zypp::url::ParamMap
563 getPathParamsMap(EEncoding eflag) const;
566 * Return the value for the specified path parameter.
568 * For example, if the path parameters string is "foo=1,bar=2"
569 * the method will return the substring "1" for the param key
570 * "foo" and "2" for the param key "bar".
572 * \param param The path parameter key.
573 * \param eflag Flag if the path parameter keys and values should
575 * \return The value for the path parameter key or empty string.
576 * \throws UrlNotSupportedException if parameter parsing
577 * is not supported for a URL (scheme).
578 * \throws UrlDecodingException if the decoded result string
579 * would contain a '\\0' character.
582 getPathParam(const std::string ¶m, EEncoding eflag) const;
587 * Returns the encoded query string component of the URL.
589 * The query string is returned without first "?" (separator)
590 * character. Further "?" characters as in e.g. LDAP URLs
591 * remains in the returned string.
593 * \return The encoded query string component of the URL.
596 getQueryString() const;
598 /** \overload Returns the safe query string (passwds stripped) unless WITH_PASSWORD is set. */
600 getQueryString( const ViewOptions & viewopts_r ) const;
603 * Returns a vector with query string parameter substrings.
605 * The default query string parameter separator is the \c '&'
607 * A schema specific object may overide the default separators.
609 * For example, the query string "foo=1&bar=2" is splited by
610 * default into a vector containing the substrings "foo=1" and
613 * \return The query string splited into a vector of substrings.
615 virtual zypp::url::ParamVec
616 getQueryStringVec() const;
619 * Returns a string map with query parameter and their values.
621 * The default query string parameter separator is the \c ','
622 * character, the default key/value separator the \c '=' character.
623 * A schema specific object may overide the default separators.
625 * For example, the query string "foo=1&bar=2" is splited by
626 * default into a map containing "foo" = "1" and "bar" = "2".
628 * \param eflag Flag if the query string keys and values should
630 * \return The query string as a key/value string map.
631 * \throws UrlNotSupportedException if parameter parsing
632 * is not supported for a URL (scheme).
633 * \throws UrlDecodingException if the decoded result string
634 * would contain a '\\0' character.
636 virtual zypp::url::ParamMap
637 getQueryStringMap(EEncoding eflag) const;
640 * Return the value for the specified query parameter.
642 * For example, if the query string is "foo=1,bar=2" the method
643 * will return the substring "1" for the param key "foo" and
644 * "2" for the param key "bar".
646 * \param param The query parameter key.
647 * \param eflag Flag if the query parameter keys and values should
649 * \return The value for the query parameter key or empty string.
650 * \throws UrlNotSupportedException if parameter parsing
651 * is not supported for a URL (scheme).
652 * \throws UrlDecodingException if the decoded result string
653 * would contain a '\\0' character.
656 getQueryParam(const std::string ¶m, EEncoding eflag) const;
661 * Returns the encoded fragment component of the URL.
662 * \param eflag Flag if the fragment should be percent-decoded or not.
663 * \return The encoded fragment component of the URL.
664 * \throws UrlDecodingException if the decoded result string
665 * would contain a '\\0' character.
668 getFragment(EEncoding eflag) const;
673 * \brief Set the scheme name in the URL.
674 * \param scheme The new scheme name.
675 * \throws UrlBadComponentException if the \p scheme
676 * contains an invalid character or is empty.
679 setScheme(const std::string &scheme);
684 * \brief Set the authority component in the URL.
686 * The \p authority string shoud not contain any leading
687 * "//" separator characters (just "user:pass@host:port").
689 * \param authority The authority component string.
690 * \throws UrlNotAllowedException if the \p authority
691 * has to be empty in for the current scheme.
692 * \throws UrlBadComponentException if the \p authority
693 * contains an invalid character.
694 * \throws UrlParsingException if \p authority parsing fails.
697 setAuthority(const std::string &authority);
700 * \brief Set the username in the URL authority.
701 * \param user The new username.
702 * \param eflag If the \p username is encoded or not.
703 * \throws UrlNotAllowedException if the \p user
704 * has to be empty in for the current scheme.
705 * \throws UrlBadComponentException if the \p user
706 * contains an invalid character.
709 setUsername(const std::string &user,
713 * \brief Set the password in the URL authority.
714 * \param pass The new password.
715 * \param eflag If the \p password is encoded or not.
716 * \throws UrlNotAllowedException if the \p pass
717 * has to be empty in for the current scheme.
718 * \throws UrlBadComponentException if the \p pass
719 * contains an invalid character.
722 setPassword(const std::string &pass,
726 * \brief Set the hostname or IP in the URL authority.
728 * The \p host parameter may contain a hostname, an IPv4 address
729 * in dotted-decimal form or an IPv6 address literal encapsulated
730 * within square brackets (RFC3513, Sect. 2.2).
732 * A hostname may contain national alphanumeric UTF8 characters
733 * (letters other than ASCII a-zA-Z), that will be encoded.
734 * This function allows to specify both, a encoded or decoded
737 * Other IP literals in "[v ... ]" square bracket format are not
738 * supported by the implementation in UrlBase class.
740 * \param host The new hostname or IP address.
741 * \throws UrlNotAllowedException if the \p host
742 * has to be empty in for the current scheme.
743 * \throws UrlBadComponentException if the \p host is invalid.
746 setHost(const std::string &host);
749 * \brief Set the port number in the URL authority.
750 * \param port The new port number.
751 * \throws UrlNotAllowedException if the \p port
752 * has to be empty in for the current scheme.
753 * \throws UrlBadComponentException if the \p port is invalid.
756 setPort(const std::string &port);
761 * \brief Set the path data component in the URL.
763 * By default, the \p pathdata string may include path
764 * parameters separated by the ";" separator character.
766 * \param pathdata The encoded path data component string.
767 * \throws UrlBadComponentException if the \p pathdata
768 * contains an invalid character.
771 setPathData(const std::string &pathdata);
774 * \brief Set the path name.
775 * \param path The new path name.
776 * \param eflag If the \p path name is encoded or not.
777 * \throws UrlBadComponentException if the \p path name
778 * contains an invalid character.
781 setPathName(const std::string &path,
785 * \brief Set the path parameters.
786 * \param params The new encoded path parameter string.
787 * \throws UrlBadComponentException if the path \p params
788 * contains an invalid character.
791 setPathParams(const std::string ¶ms);
794 * \brief Set the path parameters.
795 * \param pvec The vector with encoded path parameters.
796 * \throws UrlBadComponentException if the \p pvec
797 * contains an invalid character.
800 setPathParamsVec(const zypp::url::ParamVec &pvec);
803 * \brief Set the path parameters.
804 * \param pmap The map with decoded path parameters.
805 * \throws UrlNotSupportedException if parameter parsing
806 * is not supported for a URL (scheme).
809 setPathParamsMap(const zypp::url::ParamMap &pmap);
812 * \brief Set or add value for the specified path parameter.
813 * \param param The decoded path parameter name.
814 * \param value The decoded path parameter value.
815 * \throws UrlNotSupportedException if parameter parsing
816 * is not supported for a URL (scheme).
817 * \throws UrlDecodingException if the decoded result string
818 * would contain a '\\0' character.
821 setPathParam(const std::string ¶m, const std::string &value);
826 * \brief Set the query string in the URL.
828 * The \p querystr string parameter is supposed
829 * to not to contain the "?" URL query separator
830 * character (use just a "foo=bar&x=22" instead
831 * of "?foo=bar&x=22").
833 * \param querystr The new encoded query string.
834 * \throws UrlBadComponentException if the \p querystr
835 * contains an invalid character.
838 setQueryString(const std::string &querystr);
841 * \brief Set the query parameters.
842 * \param qvec The vector with encoded query parameters.
843 * \throws UrlBadComponentException if the \p qvec
844 * contains an invalid character.
847 setQueryStringVec(const zypp::url::ParamVec &qvec);
850 * \brief Set the query parameters.
851 * \param qmap The map with decoded query parameters.
852 * \throws UrlNotSupportedException if parameter parsing
853 * is not supported for a URL (scheme).
856 setQueryStringMap(const zypp::url::ParamMap &qmap);
859 * \brief Set or add value for the specified query parameter.
860 * \param param The decoded query parameter name.
861 * \param value The decoded query parameter value.
862 * \throws UrlNotSupportedException if parameter parsing
863 * is not supported for a URL (scheme).
864 * \throws UrlDecodingException if the decoded result string
865 * would contain a '\\0' character.
868 setQueryParam(const std::string ¶m, const std::string &value);
871 * \brief remove the specified query parameter.
872 * \param param The decoded query parameter name.
873 * \throws UrlNotSupportedException if parameter parsing
874 * is not supported for a URL (scheme).
875 * \throws UrlDecodingException if the decoded result string
876 * would contain a '\\0' character.
879 delQueryParam(const std::string ¶m);
884 * \brief Set the fragment string in the URL.
885 * \param fragment The new fragment string.
886 * \param eflag If the \p fragment is encoded or not.
887 * \throws UrlBadComponentException if the \p querystr
888 * contains an invalid character.
891 setFragment(const std::string &fragment,
897 * Configures behaviour of the instance.
899 * This method is called in UrlBase constructors before
900 * any URL components are applied.
901 * Derived classes may reimplement this method to change
902 * the behaviour of the object.
903 * Use the config() methods to query and change them.
905 * The UrlBase class uses following config variables:
907 * - Common path parameter separators:
908 * - \a \c sep_pathparams \c ";"
909 * Separator used to split path parameters from path name.
910 * Setting it to empty string disables splitting of path
911 * name and path parameters. Set also rx_pathparams to an
913 * - \a \c psep_pathparam \c ","
914 * Separator between path parameters.
915 * - \a \c vsep_pathparam \c "="
916 * Separator between key and value of a path parameter.
920 * - Common query string separators:
921 * - \a \c psep_querystr \c "&"
922 * Separator between query string parameters.
923 * - \a \c vsep_querystr \c "="
924 * Separator between key and value of a query parameter.
928 * - Characters in URL components, that are safe without
929 * URL percent-encoding (see zypp::url::encode()).
934 * - \a safe_pathparams
940 * - Regular expressions used to verify encoded URL
941 * components and their sub-components:
956 * Get the value of a UrlBase configuration variable.
958 * See configure() method for names an purpose of the
959 * configuration variables used in UrlBase class.
961 * \param opt The name of the configuration variable.
962 * \return The value of the specified variable
966 config(const std::string &opt) const;
969 * Set the value of a UrlBase configuration variable.
971 * See configure() method for names an purpose of the
972 * configuration variables used in UrlBase class.
974 * \param opt The name of the configuration variable.
975 * \param val The new value for the configuration variable.
978 config(const std::string &opt, const std::string &val);
982 * Return the view options of the current object.
984 * This method is used to query the view options
985 * used by the asString() method.
987 * \return The current view option combination.
990 getViewOptions() const;
993 * Change the view options of the current object.
995 * This method is used to change the view options
996 * used by the asString() method.
998 * \param vopts New view options combination.
1001 setViewOptions(const ViewOptions &vopts);
1003 std::string asString1050625() const;
1006 * Utility method to cleanup an encoded path name.
1008 * By default, this method makes sure, that the first slash
1009 * in the path is not encoded, and that the second slash
1010 * before the first path segment, is encoded (to "%2F").
1011 * It modifies the path in the url, for example:
1012 * "ftp://host//aaa//bbb" to "ftp://host/%2Faaa//bbb"
1013 * or as encoded path only also "%2f/name" to "/%2fname".
1015 * This operation is required to fulfill the path-absolute
1016 * rule of RFC3986, if there is no authority. It avoids the
1017 * missinterpretation of the path as an authority separator.
1019 * It is not required if there is an authority ("//" behind
1020 * the "scheme:"), that is in the path-abempty rule, but it
1021 * is used e.g. in ftp url's defined by RFC1738.
1023 * We apply this operation in both cases (for all paths),
1024 * but if \p authority is true, the encoding of the second
1025 * slash depends on the schema configuration (for ftp only).
1027 * \param path The encoded path name to cleanup.
1028 * \param authority Whether the url contains authority or not.
1029 * \return A modified encoded path.
1032 cleanupPathName(const std::string &path, bool authority) const;
1035 * Utility method to cleanup an encoded path name.
1037 * This variant of the method checks if the host component
1038 * in the url is empty or not to differentiate if there is
1041 * \param path The encoded path name to cleanup.
1042 * \return A modified encoded path.
1045 cleanupPathName(const std::string &path) const;
1048 * \brief Verifies specified host or IP.
1050 * It verifies, if the specified \p host parameter contains
1051 * a hostname, an IPv4 address in dotted-decimal form or an
1052 * IPv6 address literal encapsulated within square brackets
1053 * (RFC3513, Sect. 2.2).
1055 * A hostname in the \p host parameter, may contain national
1056 * alphanumeric UTF8 characters (letters other than ASCII
1057 * a-zA-Z) and allows to specify both, a encoded or decoded
1060 * This function does not perform any hostname lookups and
1061 * supports only IPv6 addresses in "[ ... ]" notation. The
1062 * "[v ... ]" square bracket format is not supported by
1063 * this implementation.
1065 * \param host The host name or IP to verify.
1066 * \return True, if host seems to be valid.
1069 isValidHost(const std::string &host) const;
1072 * \brief Verifies specified port number.
1074 * \param port The port number to verify.
1075 * \return True, if port number is valid.
1078 isValidPort(const std::string &port) const;
1081 UrlBaseData *m_data;
1085 // ---------------------------------------------------------------
1087 * \brief Copy-On-Write Url reference.
1089 typedef RWCOW_pointer<UrlBase> UrlRef;
1092 //////////////////////////////////////////////////////////////////
1094 ////////////////////////////////////////////////////////////////////
1096 ////////////////////////////////////////////////////////////////////
1098 //////////////////////////////////////////////////////////////////////
1100 #endif /* ZYPP_URL_URLBASE_H */
1102 ** vim: set ts=2 sts=2 sw=2 ai et: