ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/GoogleTron/Zlib/Error.hpp
(Generate patch)

Comparing:
GoogleTron/GzipWriter.hpp (file contents), Revision 674 by douglas, 2006-03-02T23:47:54-08:00 vs.
GoogleTron/Zlib/GzipWriter.hpp (file contents), Revision 680 by douglas, 2006-03-06T00:40:40-08:00

# Line 4 | Line 4
4   //
5   // $Id$
6  
7 < #ifndef _GzipWriter_hpp_
8 < #define _GzipWriter_hpp_
7 > #ifndef _Zlib_GzipWriter_hpp_
8 > #define _Zlib_GzipWriter_hpp_
9  
10   #include <cxx/platform.hpp>
11  
# Line 19 | Line 19
19   #include <errno.h>
20   #include <zlib.h>
21  
22 + namespace Zlib
23 + {
24 +
25   class Error : public api::Error
26   {
27          int code;
# Line 26 | Line 29 | class Error : public api::Error
29   public:
30          Error(gzFile file) : message(::gzerror(file, &code))
31          {
32 < //              if (code == Z_ERRNO)
32 >                if (code == Z_ERRNO)
33 > #if defined(API_HAS_POSIX)
34 >                        throw api::Posix::Error();
35 > #endif
36          }
37  
38          virtual int GetNumber() const
# Line 36 | Line 42 | public:
42  
43          virtual cse::String GetMessage() const
44          {
45 <                return message;
45 >                return _S<ios::String>() << "Zlib[#" << code << "] " << message;
46          }
47   };
48  
# Line 66 | Line 72 | public:
72          virtual void Flush();
73   };
74  
75 < #endif//_GzipWriter_hpp_
75 > }
76 >
77 > #endif//_Zlib_GzipWriter_hpp_

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines