summaryrefslogtreecommitdiff
path: root/gpr/source/lib/dng_sdk/dng_file_stream.h
diff options
context:
space:
mode:
Diffstat (limited to 'gpr/source/lib/dng_sdk/dng_file_stream.h')
-rw-r--r--gpr/source/lib/dng_sdk/dng_file_stream.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/gpr/source/lib/dng_sdk/dng_file_stream.h b/gpr/source/lib/dng_sdk/dng_file_stream.h
new file mode 100644
index 0000000..89a46b6
--- /dev/null
+++ b/gpr/source/lib/dng_sdk/dng_file_stream.h
@@ -0,0 +1,78 @@
+/*****************************************************************************/
+// Copyright 2006-2007 Adobe Systems Incorporated
+// All Rights Reserved.
+//
+// NOTICE: Adobe permits you to use, modify, and distribute this file in
+// accordance with the terms of the Adobe license agreement accompanying it.
+/*****************************************************************************/
+
+/* $Id: //mondo/dng_sdk_1_4/dng_sdk/source/dng_file_stream.h#1 $ */
+/* $DateTime: 2012/05/30 13:28:51 $ */
+/* $Change: 832332 $ */
+/* $Author: tknoll $ */
+
+/** \file
+ * Simple, portable, file read/write support.
+ */
+
+/*****************************************************************************/
+
+#ifndef __dng_file_stream__
+#define __dng_file_stream__
+
+/*****************************************************************************/
+
+#include <stdio.h>
+#include "dng_stream.h"
+
+/*****************************************************************************/
+
+/// \brief A stream to/from a disk file. See dng_stream for read/write interface
+
+class dng_file_stream: public dng_stream
+ {
+
+ private:
+
+ FILE *fFile;
+
+ public:
+
+ /// Open a stream on a file.
+ /// \param filename Pathname in platform synax.
+ /// \param output Set to true if writing, false otherwise.
+ /// \param bufferSize size of internal buffer to use. Defaults to 4k.
+
+ dng_file_stream (const char *filename,
+ bool output = false,
+ uint32 bufferSize = kDefaultBufferSize);
+
+ virtual ~dng_file_stream ();
+
+ protected:
+
+ virtual uint64 DoGetLength ();
+
+ virtual void DoRead (void *data,
+ uint32 count,
+ uint64 offset);
+
+ virtual void DoWrite (const void *data,
+ uint32 count,
+ uint64 offset);
+
+ private:
+
+ // Hidden copy constructor and assignment operator.
+
+ dng_file_stream (const dng_file_stream &stream);
+
+ dng_file_stream & operator= (const dng_file_stream &stream);
+
+ };
+
+/*****************************************************************************/
+
+#endif
+
+/*****************************************************************************/