Poco::URI: added new constructor to create URI from Path

This commit is contained in:
Guenter Obiltschnig
2014-10-12 11:19:52 +02:00
parent 102413aed5
commit 50f1f12cab
4 changed files with 40 additions and 0 deletions

View File

@@ -19,6 +19,7 @@
#include "Poco/Exception.h"
#include "Poco/String.h"
#include "Poco/NumberParser.h"
#include "Poco/Path.h"
namespace Poco {
@@ -125,6 +126,16 @@ URI::URI(const URI& baseURI, const std::string& relativeURI):
}
URI::URI(const Path& path):
_scheme("file"),
_port(0)
{
Path absolutePath(path);
absolutePath.makeAbsolute();
_path = absolutePath.toString(Path::PATH_UNIX);
}
URI::~URI()
{
}