[Hdrflow-svn] SF.net SVN: hdrflow: [154] trunk/lib/openlibraries/src/openpluginlib/pl
Status: Pre-Alpha
Brought to you by:
glslang
|
From: <gl...@us...> - 2007-06-17 08:29:26
|
Revision: 154
http://hdrflow.svn.sourceforge.net/hdrflow/?rev=154&view=rev
Author: glslang
Date: 2007-06-17 01:29:21 -0700 (Sun, 17 Jun 2007)
Log Message:
-----------
+ initial stream abstraction
Modified Paths:
--------------
trunk/lib/openlibraries/src/openpluginlib/pl/pl_vc8.vcproj
Added Paths:
-----------
trunk/lib/openlibraries/src/openpluginlib/pl/stream.cpp
trunk/lib/openlibraries/src/openpluginlib/pl/stream.hpp
Modified: trunk/lib/openlibraries/src/openpluginlib/pl/pl_vc8.vcproj
===================================================================
--- trunk/lib/openlibraries/src/openpluginlib/pl/pl_vc8.vcproj 2007-06-16 22:00:18 UTC (rev 153)
+++ trunk/lib/openlibraries/src/openpluginlib/pl/pl_vc8.vcproj 2007-06-17 08:29:21 UTC (rev 154)
@@ -261,6 +261,10 @@
>
</File>
<File
+ RelativePath=".\stream.cpp"
+ >
+ </File>
+ <File
RelativePath=".\pcos\subject.cpp"
>
</File>
@@ -399,6 +403,10 @@
>
</File>
<File
+ RelativePath=".\stream.hpp"
+ >
+ </File>
+ <File
RelativePath=".\string.hpp"
>
</File>
Added: trunk/lib/openlibraries/src/openpluginlib/pl/stream.cpp
===================================================================
--- trunk/lib/openlibraries/src/openpluginlib/pl/stream.cpp (rev 0)
+++ trunk/lib/openlibraries/src/openpluginlib/pl/stream.cpp 2007-06-17 08:29:21 UTC (rev 154)
@@ -0,0 +1,17 @@
+
+// openpluginlib - A plugin interface to openlibraries.
+
+// Copyright (C) 2007 Goncalo Nuno M. de Carvalho
+// Released under the LGPL.
+// For more information, see http://www.openlibraries.org.
+
+#include <openpluginlib/pl/stream.hpp>
+
+namespace olib { namespace openpluginlib {
+
+stream_ptr make_stream( const string&, int )
+{
+ return stream_ptr( );
+}
+
+} }
Added: trunk/lib/openlibraries/src/openpluginlib/pl/stream.hpp
===================================================================
--- trunk/lib/openlibraries/src/openpluginlib/pl/stream.hpp (rev 0)
+++ trunk/lib/openlibraries/src/openpluginlib/pl/stream.hpp 2007-06-17 08:29:21 UTC (rev 154)
@@ -0,0 +1,60 @@
+
+// openpluginlib - A plugin interface to openlibraries.
+
+// Copyright (C) 2007 Goncalo Nuno M. de Carvalho
+// Released under the LGPL.
+// For more information, see http://www.openlibraries.org.
+
+#ifndef STREAM_INC_
+#define STREAM_INC_
+
+#include <boost/shared_ptr.hpp>
+
+#include <openpluginlib/pl/config.hpp>
+#include <openpluginlib/pl/string.hpp>
+
+namespace olib { namespace openpluginlib {
+
+class OPENPLUGINLIB_DECLSPEC stream
+{
+public:
+ typedef char value_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+
+public:
+ static const int in_stream = 1;
+ static const int out_stream = 2;
+ static const int binary_stream = 4;
+
+public:
+ explicit stream( pointer data = 0, int flags = in_stream | out_stream | binary_stream )
+ : data_( data )
+ , flags_( flags )
+ { }
+
+ int read( pointer, int );
+ int write( const_pointer, int );
+ long seek( long, int );
+
+ int flags( ) const;
+ bool is_thread_safe( ) const;
+ bool is_null( ) const { return data_ == ( pointer ) 0; }
+
+private:
+ stream( const stream& );
+ stream& operator=( const stream& );
+
+private:
+ pointer data_;
+ int flags_;
+};
+
+typedef boost::shared_ptr<stream> stream_ptr;
+
+stream_ptr make_stream( const string& path, int flags );
+stream_ptr make_stream( void* data, int flags );
+
+} }
+
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|