16#ifndef ZYPP_NG_RPC_ZEROCOPYSTREAMS_H_INCLUDED
17#define ZYPP_NG_RPC_ZEROCOPYSTREAMS_H_INCLUDED
19#ifndef PROTOBUFLITE_HAS_NO_ZEROCOPYSTREAM
22#include <google/protobuf/io/zero_copy_stream_impl.h>
73#include <google/protobuf/io/zero_copy_stream.h>
74#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
75#include <google/protobuf/stubs/common.h>
87class FileInputStream :
public google::protobuf::io::ZeroCopyInputStream {
105 void SetCloseOnDelete(
bool value) { copying_input_.SetCloseOnDelete(value); }
111 int GetErrno() {
return copying_input_.GetErrno(); }
114 bool Next(
const void** data,
int* size);
115 void BackUp(
int count);
116 bool Skip(
int count);
117 google::protobuf::int64 ByteCount()
const;
120 class CopyingFileInputStream :
public google::protobuf::io::CopyingInputStream {
122 CopyingFileInputStream(
int file_descriptor);
123 ~CopyingFileInputStream();
126 void SetCloseOnDelete(
bool value) { close_on_delete_ = value; }
127 int GetErrno() {
return errno_; }
130 int Read(
void* buffer,
int size);
136 bool close_on_delete_;
144 bool previous_seek_failed_;
146 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CopyingFileInputStream);
149 CopyingFileInputStream copying_input_;
150 google::protobuf::io::CopyingInputStreamAdaptor impl_;
188 void SetCloseOnDelete(
bool value) { copying_output_.SetCloseOnDelete(value); }
194 int GetErrno() {
return copying_output_.GetErrno(); }
197 bool Next(
void** data,
int* size);
198 void BackUp(
int count);
199 google::protobuf::int64 ByteCount()
const;
202 class CopyingFileOutputStream :
public google::protobuf::io::CopyingOutputStream {
204 CopyingFileOutputStream(
int file_descriptor);
205 ~CopyingFileOutputStream();
208 void SetCloseOnDelete(
bool value) { close_on_delete_ = value; }
209 int GetErrno() {
return errno_; }
212 bool Write(
const void* buffer,
int size);
217 bool close_on_delete_;
223 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CopyingFileOutputStream);
226 CopyingFileOutputStream copying_output_;
227 google::protobuf::io::CopyingOutputStreamAdaptor impl_;
google::protobuf::io::FileInputStream FileInputStream
google::protobuf::io::FileOutputStream FileOutputStream