diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
commit | 2d37894b1b037cf24231090eda8589bbb44fb6fc (patch) | |
tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/libs/poco/Net/src/FilePartSource.cpp | |
parent | 718c552901d703c502ccbefdfc3c9028d608b947 (diff) | |
download | ydb-2d37894b1b037cf24231090eda8589bbb44fb6fc.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 2 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 4309136649..afd3a01db7 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 |