FileStreamFactory.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // FileStreamFactory.h
  3. //
  4. // Library: Foundation
  5. // Package: URI
  6. // Module: FileStreamFactory
  7. //
  8. // Definition of the FileStreamFactory class.
  9. //
  10. // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
  11. // and Contributors.
  12. //
  13. // SPDX-License-Identifier: BSL-1.0
  14. //
  15. #ifndef Foundation_FileStreamFactory_INCLUDED
  16. #define Foundation_FileStreamFactory_INCLUDED
  17. #include "Poco/Foundation.h"
  18. #include "Poco/URIStreamFactory.h"
  19. namespace Poco {
  20. class Path;
  21. class Foundation_API FileStreamFactory: public URIStreamFactory
  22. /// An implementation of the URIStreamFactory interface
  23. /// that handles file URIs.
  24. {
  25. public:
  26. FileStreamFactory();
  27. /// Creates the FileStreamFactory.
  28. ~FileStreamFactory();
  29. /// Destroys the FileStreamFactory.
  30. std::istream* open(const URI& uri);
  31. /// Creates and opens a file stream in binary mode for the given URI.
  32. /// The URI must be either a file URI or a relative URI reference
  33. /// containing a path to a local file.
  34. ///
  35. /// Throws an FileNotFound exception if the file cannot
  36. /// be opened.
  37. std::istream* open(const Path& path);
  38. /// Creates and opens a file stream in binary mode for the given path.
  39. ///
  40. /// Throws an FileNotFound exception if the file cannot
  41. /// be opened.
  42. };
  43. } // namespace Poco
  44. #endif // Foundation_FileStreamFactory_INCLUDED