00001
00002
00003
00004
00005
00006
00007
00008
00012 #ifndef ZYPP_BASE_INPUTSTREAM_H
00013 #define ZYPP_BASE_INPUTSTREAM_H
00014
00015 #include <iosfwd>
00016
00017 #include "zypp/base/PtrTypes.h"
00018 #include "zypp/Pathname.h"
00019
00021 namespace zypp
00022 {
00023
00025
00026
00027
00055 class InputStream
00056 {
00057 public:
00059 InputStream();
00060
00062 InputStream( std::istream & stream_r,
00063 const std::string & name_r = std::string() );
00064
00066 InputStream( const Pathname & file_r );
00067
00069 InputStream( const Pathname & file_r,
00070 const std::string & name_r );
00071
00073 InputStream( const std::string & file_r );
00074
00076 InputStream( const std::string & file_r,
00077 const std::string & name_r );
00078
00080 InputStream( const char * file_r );
00081
00083 InputStream( const char * file_r,
00084 const std::string & name_r );
00085
00087 ~InputStream();
00088
00092 std::istream & stream() const
00093 { return *_stream; }
00094
00096 operator std::istream &()
00097 { return *_stream; }
00098
00106 const std::string & name() const
00107 { return _name; }
00108
00110 const Pathname & path() const
00111 { return _path; }
00112
00113 private:
00114 Pathname _path;
00115 shared_ptr<std::istream> _stream;
00116 std::string _name;
00117 };
00119
00121 std::ostream & operator<<( std::ostream & str, const InputStream & obj );
00122
00124 }
00126 #endif // ZYPP_BASE_INPUTSTREAM_H