diff --git a/tools/src/librtools/RparseUrl.cpp b/tools/src/librtools/RparseUrl.cpp index 81161022..12096bd2 100644 --- a/tools/src/librtools/RparseUrl.cpp +++ b/tools/src/librtools/RparseUrl.cpp @@ -1,6 +1,6 @@ -// $Id: RparseUrl.cpp 686 2015-06-04 21:08:08Z mueller $ +// $Id: RparseUrl.cpp 875 2017-04-15 21:58:50Z mueller $ // -// Copyright 2013-2015 by Walter F.J. Mueller +// Copyright 2013-2017 by Walter F.J. Mueller // // This program is free software; you may redistribute and/or modify it under // the terms of the GNU General Public License as published by the Free @@ -13,6 +13,7 @@ // // Revision History: // Date Rev Version Comment +// 2017-04-15 875 1.1 add Set() with default scheme handling // 2015-06-04 686 1.0.2 Set(): add check that optlist is enclosed by '|' // 2013-02-23 492 1.0.1 add static FindScheme(); allow no or empty scheme // 2013-02-03 481 1.0 Initial version, extracted from RlinkPort @@ -20,7 +21,7 @@ /*! \file - \version $Id: RparseUrl.cpp 686 2015-06-04 21:08:08Z mueller $ + \version $Id: RparseUrl.cpp 875 2017-04-15 21:58:50Z mueller $ \brief Implemenation of RparseUrl. */ @@ -135,6 +136,20 @@ bool RparseUrl::Set(const std::string& url, const std::string& optlist, //------------------------------------------+----------------------------------- //! FIXME_docs +bool RparseUrl::Set(const std::string& url, const std::string& optlist, + const std::string& scheme, RerrMsg& emsg) +{ + if (FindScheme(url).length() == 0 && scheme.length() > 0) { + string url1 = scheme + string(":") + url; + return Set(url1, optlist, emsg); + } + + return Set(url, optlist, emsg); +} + +//------------------------------------------+----------------------------------- +//! FIXME_docs + void RparseUrl::Clear() { fUrl.clear(); diff --git a/tools/src/librtools/RparseUrl.hpp b/tools/src/librtools/RparseUrl.hpp index 080f3587..a15b5e00 100644 --- a/tools/src/librtools/RparseUrl.hpp +++ b/tools/src/librtools/RparseUrl.hpp @@ -1,6 +1,6 @@ -// $Id: RparseUrl.hpp 492 2013-02-24 22:14:47Z mueller $ +// $Id: RparseUrl.hpp 875 2017-04-15 21:58:50Z mueller $ // -// Copyright 2013- by Walter F.J. Mueller +// Copyright 2013-2017 by Walter F.J. Mueller // // This program is free software; you may redistribute and/or modify it under // the terms of the GNU General Public License as published by the Free @@ -13,13 +13,14 @@ // // Revision History: // Date Rev Version Comment +// 2017-04-15 875 1.1 add Set() with default scheme handling // 2013-02-23 492 1.0.1 add static FindScheme(); allow no or empty scheme // 2013-02-03 481 1.0 Initial version, extracted from RlinkPort // --------------------------------------------------------------------------- /*! \file - \version $Id: RparseUrl.hpp 492 2013-02-24 22:14:47Z mueller $ + \version $Id: RparseUrl.hpp 875 2017-04-15 21:58:50Z mueller $ \brief Declaration of class RparseUrl. */ @@ -45,6 +46,8 @@ namespace Retro { bool Set(const std::string& url, const std::string& optlist, RerrMsg& emsg); + bool Set(const std::string& url, const std::string& optlist, + const std::string& scheme, RerrMsg& emsg); void SetPath(const std::string& path); void Clear();