FileStreamFactory.h 1.4 KB

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