12#ifndef ZYPP_CORE_BASE_SIMPLESTREAMBUF_H_DEFINED
13#define ZYPP_CORE_BASE_SIMPLESTREAMBUF_H_DEFINED
53 template<
typename Impl>
62 template <
typename OpenSpecType>
65 if ( !this->openImpl( std::forward<OpenSpecType>(
name_r),
mode_r ) )
68 if ( this->canRead() ) {
81 if ( !this->isOpen() )
84 if ( this->canWrite() )
87 if ( !this->closeImpl() )
99 if ( traits_type::eq_int_type(
res, traits_type::eof() ) )
107 if ( this->canWrite() ) {
108 if ( ! traits_type::eq_int_type(
c, traits_type::eof() ) )
110 *
pptr() = traits_type::to_char_type(
c );
118 ret = traits_type::not_eof(
c );
128 if ( this->canRead() )
131 return traits_type::to_int_type( *
gptr() );
137 ret = traits_type::to_int_type( *
gptr() );
156 if ( !this->canSeek(
way_r) )
159 if ( this->isOpen() ) {
160 if (
openMode == std::ios_base::out ) {
162 if ( !this->canWrite() ||
sync() != 0 )
167 }
else if (
openMode == std::ios_base::in ) {
168 if ( !this->canRead() )
175 if (
way_r == std::ios_base::end ) {
186 if (
way_r == std::ios_base::cur ) {
188 way_r = std::ios_base::beg;
192 if (
way_r == std::ios_base::beg ) {
RepoManager implementation.
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
~SimpleStreamBuf() override
SimpleStreamBuf * close()
SimpleStreamBuf * open(OpenSpecType &&name_r, std::ios_base::openmode mode_r=std::ios_base::in)
pos_type seekoff(off_type off_r, std::ios_base::seekdir way_r, std::ios_base::openmode openMode) override
pos_type seekpos(pos_type pos_r, std::ios_base::openmode openMode) override
int_type underflow() override
int_type overflow(int_type c=traits_type::eof()) override
std::vector< char > buffer_type
SimpleStreamBuf(size_t bufsize_r=512)
Easy-to use interface to the ZYPP dependency resolver.