mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 16:57:16 +01:00
4a6bfc086c
Switched to POCO library for unified platform/library interface. Deprecated the external module API. It was creating more problems than solving. Removed most built-in libraries in favor of system libraries for easier maintenance. Cleaned and secured code with help from static analyzers.
55 lines
918 B
C++
55 lines
918 B
C++
//
|
|
// DataURIStreamFactory.cpp
|
|
//
|
|
// Library: Foundation
|
|
// Package: URI
|
|
// Module: DataURIStreamFactory
|
|
//
|
|
// Copyright (c) 2019, Applied Informatics Software Engineering GmbH.
|
|
// and Contributors.
|
|
//
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
//
|
|
|
|
|
|
#include "Poco/DataURIStreamFactory.h"
|
|
#include "Poco/DataURIStream.h"
|
|
#include "Poco/URI.h"
|
|
#include "Poco/URIStreamOpener.h"
|
|
|
|
|
|
namespace Poco {
|
|
|
|
|
|
DataURIStreamFactory::DataURIStreamFactory()
|
|
{
|
|
}
|
|
|
|
|
|
DataURIStreamFactory::~DataURIStreamFactory()
|
|
{
|
|
}
|
|
|
|
|
|
std::istream* DataURIStreamFactory::open(const URI& uri)
|
|
{
|
|
poco_assert (uri.getScheme() == "data");
|
|
|
|
return new DataURIStream(uri);
|
|
}
|
|
|
|
|
|
void DataURIStreamFactory::registerFactory()
|
|
{
|
|
URIStreamOpener::defaultOpener().registerStreamFactory("data", new DataURIStreamFactory);
|
|
}
|
|
|
|
|
|
void DataURIStreamFactory::unregisterFactory()
|
|
{
|
|
URIStreamOpener::defaultOpener().unregisterStreamFactory("data");
|
|
}
|
|
|
|
|
|
} // namespace Poco
|