aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-06-22 15:02:36 +0000
committerlloyd <[email protected]>2010-06-22 15:02:36 +0000
commitd922d15103274c653bc3fc69da4a2bd83b82e0aa (patch)
tree220320137f59cb5c977a1a80f2ea88a51b8ff9b0 /src
parent6d9ad105f26ce29b15a3d2a1dc8d3f842bc281b0 (diff)
We can't hide the filter wrappers in an anon namespace because they
are forward declared in the headers.
Diffstat (limited to 'src')
-rw-r--r--src/filters/bzip2/bzip2.cpp16
-rw-r--r--src/filters/zlib/zlib.cpp16
2 files changed, 26 insertions, 6 deletions
diff --git a/src/filters/bzip2/bzip2.cpp b/src/filters/bzip2/bzip2.cpp
index b4b04a13e..022ddedf1 100644
--- a/src/filters/bzip2/bzip2.cpp
+++ b/src/filters/bzip2/bzip2.cpp
@@ -54,14 +54,22 @@ void bzip_free(void* info_ptr, void* ptr)
info->alloc->deallocate(ptr, i->second);
}
-/*
+}
+
+/**
* Wrapper Type for Bzip2 Stream
*/
class Bzip_Stream
{
public:
+ /**
+ * Underlying stream
+ */
bz_stream stream;
+ /**
+ * Constructor
+ */
Bzip_Stream()
{
std::memset(&stream, 0, sizeof(bz_stream));
@@ -69,6 +77,10 @@ class Bzip_Stream
stream.bzfree = bzip_free;
stream.opaque = new Bzip_Alloc_Info;
}
+
+ /**
+ * Destructor
+ */
~Bzip_Stream()
{
Bzip_Alloc_Info* info = static_cast<Bzip_Alloc_Info*>(stream.opaque);
@@ -77,8 +89,6 @@ class Bzip_Stream
}
};
-}
-
/*
* Bzip_Compression Constructor
*/
diff --git a/src/filters/zlib/zlib.cpp b/src/filters/zlib/zlib.cpp
index 148ed3e6c..6d8a22b9e 100644
--- a/src/filters/zlib/zlib.cpp
+++ b/src/filters/zlib/zlib.cpp
@@ -53,14 +53,22 @@ void zlib_free(void* info_ptr, void* ptr)
info->alloc->deallocate(ptr, i->second);
}
-/*
+}
+
+/**
* Wrapper Type for Zlib z_stream
*/
class Zlib_Stream
{
public:
+ /**
+ * Underlying stream
+ */
z_stream stream;
+ /**
+ * Constructor
+ */
Zlib_Stream()
{
std::memset(&stream, 0, sizeof(z_stream));
@@ -68,6 +76,10 @@ class Zlib_Stream
stream.zfree = zlib_free;
stream.opaque = new Zlib_Alloc_Info;
}
+
+ /**
+ * Destructor
+ */
~Zlib_Stream()
{
Zlib_Alloc_Info* info = static_cast<Zlib_Alloc_Info*>(stream.opaque);
@@ -76,8 +88,6 @@ class Zlib_Stream
}
};
-}
-
/*
* Zlib_Compression Constructor
*/