diff options
| author | orivej <[email protected]> | 2022-02-10 16:44:49 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:44:49 +0300 |
| commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
| tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/libs/poco/Net/src/FilePartSource.cpp | |
| parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/poco/Net/src/FilePartSource.cpp')
| -rw-r--r-- | contrib/libs/poco/Net/src/FilePartSource.cpp | 174 |
1 files changed, 87 insertions, 87 deletions
diff --git a/contrib/libs/poco/Net/src/FilePartSource.cpp b/contrib/libs/poco/Net/src/FilePartSource.cpp index afd3a01db70..43091366493 100644 --- a/contrib/libs/poco/Net/src/FilePartSource.cpp +++ b/contrib/libs/poco/Net/src/FilePartSource.cpp @@ -1,87 +1,87 @@ -// -// FilePartSource.cpp -// -// Library: Net -// Package: Messages -// Module: FilePartSource -// -// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Net/FilePartSource.h" -#include "Poco/Path.h" -#include "Poco/File.h" -#include "Poco/Exception.h" - - -using Poco::Path; -using Poco::OpenFileException; - - -namespace Poco { -namespace Net { - - -FilePartSource::FilePartSource(const std::string& path): - _path(path), _istr(path) -{ - Path p(path); - _filename = p.getFileName(); - if (!_istr.good()) - throw OpenFileException(path); -} - - -FilePartSource::FilePartSource(const std::string& path, const std::string& mediaType): - PartSource(mediaType), - _path(path), - _istr(path) -{ - Path p(path); - _filename = p.getFileName(); - if (!_istr.good()) - throw OpenFileException(path); -} - - -FilePartSource::FilePartSource(const std::string& path, const std::string& filename, const std::string& mediaType): - PartSource(mediaType), - _path(path), - _filename(filename), - _istr(path) -{ - Path p(path); - if (!_istr.good()) - throw OpenFileException(path); -} - - -FilePartSource::~FilePartSource() -{ -} - - -std::istream& FilePartSource::stream() -{ - return _istr; -} - - -const std::string& FilePartSource::filename() const -{ - return _filename; -} - - -std::streamsize FilePartSource::getContentLength() const -{ - Poco::File p(_path); - return static_cast<std::streamsize>(p.getSize()); -} - - -} } // namespace Poco::Net +// +// FilePartSource.cpp +// +// Library: Net +// Package: Messages +// Module: FilePartSource +// +// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Net/FilePartSource.h" +#include "Poco/Path.h" +#include "Poco/File.h" +#include "Poco/Exception.h" + + +using Poco::Path; +using Poco::OpenFileException; + + +namespace Poco { +namespace Net { + + +FilePartSource::FilePartSource(const std::string& path): + _path(path), _istr(path) +{ + Path p(path); + _filename = p.getFileName(); + if (!_istr.good()) + throw OpenFileException(path); +} + + +FilePartSource::FilePartSource(const std::string& path, const std::string& mediaType): + PartSource(mediaType), + _path(path), + _istr(path) +{ + Path p(path); + _filename = p.getFileName(); + if (!_istr.good()) + throw OpenFileException(path); +} + + +FilePartSource::FilePartSource(const std::string& path, const std::string& filename, const std::string& mediaType): + PartSource(mediaType), + _path(path), + _filename(filename), + _istr(path) +{ + Path p(path); + if (!_istr.good()) + throw OpenFileException(path); +} + + +FilePartSource::~FilePartSource() +{ +} + + +std::istream& FilePartSource::stream() +{ + return _istr; +} + + +const std::string& FilePartSource::filename() const +{ + return _filename; +} + + +std::streamsize FilePartSource::getContentLength() const +{ + Poco::File p(_path); + return static_cast<std::streamsize>(p.getSize()); +} + + +} } // namespace Poco::Net |
