diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/libs/poco/Foundation/src/FileStream.cpp | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/poco/Foundation/src/FileStream.cpp')
-rw-r--r-- | contrib/libs/poco/Foundation/src/FileStream.cpp | 242 |
1 files changed, 121 insertions, 121 deletions
diff --git a/contrib/libs/poco/Foundation/src/FileStream.cpp b/contrib/libs/poco/Foundation/src/FileStream.cpp index 4f94a24908..bfa0d2836d 100644 --- a/contrib/libs/poco/Foundation/src/FileStream.cpp +++ b/contrib/libs/poco/Foundation/src/FileStream.cpp @@ -1,121 +1,121 @@ -// -// FileStream.cpp -// -// Library: Foundation -// Package: Streams -// Module: FileStream -// -// Copyright (c) 2007, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/FileStream.h" -#include "Poco/Exception.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -#include "FileStream_WIN32.cpp" -#else -#include "FileStream_POSIX.cpp" -#endif - - -namespace Poco { - - -FileIOS::FileIOS(std::ios::openmode defaultMode): - _defaultMode(defaultMode) -{ - poco_ios_init(&_buf); -} - - -FileIOS::~FileIOS() -{ -} - - -void FileIOS::open(const std::string& path, std::ios::openmode mode) -{ - clear(); - _buf.open(path, mode | _defaultMode); -} - - -void FileIOS::close() -{ - if (!_buf.close()) - { - setstate(ios_base::badbit); - } -} - - -FileStreamBuf* FileIOS::rdbuf() -{ - return &_buf; -} - - -FileInputStream::FileInputStream(): - FileIOS(std::ios::in), - std::istream(&_buf) -{ -} - - -FileInputStream::FileInputStream(const std::string& path, std::ios::openmode mode): - FileIOS(std::ios::in), - std::istream(&_buf) -{ - open(path, mode); -} - - -FileInputStream::~FileInputStream() -{ -} - - -FileOutputStream::FileOutputStream(): - FileIOS(std::ios::out), - std::ostream(&_buf) -{ -} - - -FileOutputStream::FileOutputStream(const std::string& path, std::ios::openmode mode): - FileIOS(std::ios::out), - std::ostream(&_buf) -{ - open(path, mode); -} - - -FileOutputStream::~FileOutputStream() -{ -} - - -FileStream::FileStream(): - FileIOS(std::ios::in | std::ios::out), - std::iostream(&_buf) -{ -} - - -FileStream::FileStream(const std::string& path, std::ios::openmode mode): - FileIOS(std::ios::in | std::ios::out), - std::iostream(&_buf) -{ - open(path, mode); -} - - -FileStream::~FileStream() -{ -} - - -} // namespace Poco +// +// FileStream.cpp +// +// Library: Foundation +// Package: Streams +// Module: FileStream +// +// Copyright (c) 2007, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/FileStream.h" +#include "Poco/Exception.h" +#if defined(POCO_OS_FAMILY_WINDOWS) +#include "FileStream_WIN32.cpp" +#else +#include "FileStream_POSIX.cpp" +#endif + + +namespace Poco { + + +FileIOS::FileIOS(std::ios::openmode defaultMode): + _defaultMode(defaultMode) +{ + poco_ios_init(&_buf); +} + + +FileIOS::~FileIOS() +{ +} + + +void FileIOS::open(const std::string& path, std::ios::openmode mode) +{ + clear(); + _buf.open(path, mode | _defaultMode); +} + + +void FileIOS::close() +{ + if (!_buf.close()) + { + setstate(ios_base::badbit); + } +} + + +FileStreamBuf* FileIOS::rdbuf() +{ + return &_buf; +} + + +FileInputStream::FileInputStream(): + FileIOS(std::ios::in), + std::istream(&_buf) +{ +} + + +FileInputStream::FileInputStream(const std::string& path, std::ios::openmode mode): + FileIOS(std::ios::in), + std::istream(&_buf) +{ + open(path, mode); +} + + +FileInputStream::~FileInputStream() +{ +} + + +FileOutputStream::FileOutputStream(): + FileIOS(std::ios::out), + std::ostream(&_buf) +{ +} + + +FileOutputStream::FileOutputStream(const std::string& path, std::ios::openmode mode): + FileIOS(std::ios::out), + std::ostream(&_buf) +{ + open(path, mode); +} + + +FileOutputStream::~FileOutputStream() +{ +} + + +FileStream::FileStream(): + FileIOS(std::ios::in | std::ios::out), + std::iostream(&_buf) +{ +} + + +FileStream::FileStream(const std::string& path, std::ios::openmode mode): + FileIOS(std::ios::in | std::ios::out), + std::iostream(&_buf) +{ + open(path, mode); +} + + +FileStream::~FileStream() +{ +} + + +} // namespace Poco |