OSDN Git Service

Merge branch 'feature/#36529_SlimDXからSharpDXへの移行' into develop
[dtxmania/dtxmania.git] / SlimDXc_Jun2010(VC++2008) / source / DataStream.h
diff --git a/SlimDXc_Jun2010(VC++2008)/source/DataStream.h b/SlimDXc_Jun2010(VC++2008)/source/DataStream.h
deleted file mode 100644 (file)
index c56f942..0000000
+++ /dev/null
@@ -1,297 +0,0 @@
-/*\r
-* Copyright (c) 2007-2010 SlimDX Group\r
-* \r
-* Permission is hereby granted, free of charge, to any person obtaining a copy\r
-* of this software and associated documentation files (the "Software"), to deal\r
-* in the Software without restriction, including without limitation the rights\r
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-* copies of the Software, and to permit persons to whom the Software is\r
-* furnished to do so, subject to the following conditions:\r
-* \r
-* The above copyright notice and this permission notice shall be included in\r
-* all copies or substantial portions of the Software.\r
-* \r
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-* THE SOFTWARE.\r
-*/\r
-#pragma once\r
-\r
-#include <d3dx9.h>\r
-\r
-#ifdef XMLDOCS\r
-using System::InvalidOperationException;\r
-using System::ArgumentException;\r
-using System::ArgumentNullException;\r
-using System::ArgumentOutOfRangeException;\r
-using System::NotSupportedException;\r
-using System::IO::EndOfStreamException;\r
-#endif\r
-\r
-namespace SlimDX\r
-{\r
-       /// <summary>\r
-       /// Provides a stream interface to a buffer located in unmanaged memory.\r
-       /// </summary>\r
-       /// <unmanaged>None</unmanaged>\r
-       public ref class DataStream : public System::IO::Stream, System::IDisposable\r
-       {\r
-       private:\r
-               char* m_Buffer;\r
-               bool m_OwnsBuffer;\r
-               ID3DXBuffer *m_ID3DXBuffer;\r
-               \r
-               System::Int64 m_Size;\r
-               System::Int64 m_Position;\r
-               \r
-               initonly bool m_CanRead;\r
-               initonly bool m_CanWrite;\r
-\r
-               System::Runtime::InteropServices::GCHandle m_GCHandle;\r
-\r
-       internal:\r
-               DataStream( ID3DXBuffer *buffer );\r
-               DataStream( void* buffer, System::Int64 sizeInBytes, bool canRead, bool canWrite, bool makeCopy );\r
-               DataStream( const void *buffer, System::Int64 sizeInBytes, bool canRead, bool makeCopy );\r
-\r
-               property char* RawPointer\r
-               {\r
-                       char* get();\r
-               }\r
-\r
-               property char* PositionPointer\r
-               {\r
-                       char* get();\r
-               }\r
-\r
-               property System::Int64 RemainingLength\r
-               {\r
-                       System::Int64 get();\r
-               }\r
-\r
-               char* SeekToEnd();\r
-\r
-               ID3DXBuffer* GetD3DBuffer();\r
-               void Destruct();\r
-\r
-       public:\r
-               /// <summary>\r
-               /// Initializes a new instance of the <see cref="DataStream"/> class, and allocates a new buffer to use as a backing store.\r
-               /// </summary>\r
-               /// <param name="sizeInBytes">The size of the buffer to be allocated, in bytes.</param>\r
-               /// <param name="canRead"><c>true</c> if reading from the buffer should be allowed; otherwise, <c>false</c>.</param>\r
-               /// <param name="canWrite"><c>true</c> if writing to the buffer should be allowed; otherwise, <c>false</c>.</param>\r
-               /// <exception cref="ArgumentOutOfRangeException"><paramref name="sizeInBytes" /> is less than 1.</exception>\r
-               DataStream( System::Int64 sizeInBytes, bool canRead, bool canWrite );\r
-\r
-               /// <summary>\r
-               /// Initializes a new instance of the <see cref="DataStream"/> class, using an unmanaged buffer as a backing store.\r
-               /// </summary>\r
-               /// <param name="userBuffer">A pointer to the buffer to be used as a backing store.</param>\r
-               /// <param name="sizeInBytes">The size of the buffer provided, in bytes.</param>\r
-               /// <param name="canRead"><c>true</c> if reading from the buffer should be allowed; otherwise, <c>false</c>.</param>\r
-               /// <param name="canWrite"><c>true</c> if writing to the buffer should be allowed; otherwise, <c>false</c>.</param>\r
-               /// <exception cref="ArgumentNullException"><paramref name="userBuffer" /> is a zero pointer.</exception>\r
-               /// <exception cref="ArgumentOutOfRangeException"><paramref name="sizeInBytes" /> is less than 1.</exception>\r
-               DataStream( System::IntPtr userBuffer, System::Int64 sizeInBytes, bool canRead, bool canWrite );\r
-               \r
-               /// <summary>\r
-               /// Initializes a new instance of the <see cref="DataStream"/> class, using a managed buffer as a backing store.\r
-               /// </summary>\r
-               /// <param name="userBuffer">A managed array to be used as a backing store.</param>\r
-               /// <param name="canRead"><c>true</c> if reading from the buffer should be allowed; otherwise, <c>false</c>.</param>\r
-               /// <param name="canWrite"><c>true</c> if writing to the buffer should be allowed; otherwise, <c>false</c>.</param>\r
-               DataStream( System::Array^ userBuffer, bool canRead, bool canWrite );\r
-               \r
-               /// <summary>\r
-               /// Releases all resources used by the <see cref="DataStream"/>.\r
-               /// </summary>\r
-               ~DataStream();\r
-\r
-               /// <summary>\r
-               /// Releases unmanaged resources and performs other cleanup operations before the <see cref="DataStream"/> is reclaimed by garbage collection.\r
-               /// </summary>\r
-               !DataStream();\r
-               \r
-               /// <summary>Sets the position within the current stream.</summary>\r
-               /// <exception cref="InvalidOperationException">Attempted to seek outside of the bounds of the stream.</exception>\r
-               virtual System::Int64 Seek( System::Int64 offset, System::IO::SeekOrigin origin ) override;\r
-\r
-               /// <summary>\r
-               /// Writes a single value to the stream, and advances the current position\r
-               /// within this stream by the number of bytes written.\r
-               /// </summary>\r
-               /// <typeparam name="T">The type of the value to be written to the stream.</typeparam>\r
-               /// <param name="value">The value to write to the stream.</param>\r
-               /// <exception cref="NotSupportedException">The stream does not support writing.</exception>\r
-               /// <exception cref="EndOfStreamException">There is not enough space\r
-               /// remaining in the stream to write this type of value.</exception>\r
-               generic<typename T> where T : value class\r
-               void Write( T value );\r
-\r
-               /// <summary>\r
-               /// Writes a sequence of bytes to the current stream and advances the current\r
-               /// position within this stream by the number of bytes written.\r
-               /// </summary>\r
-               /// <param name="buffer">An array of bytes. This method copies count bytes from buffer to the current stream.</param>\r
-               /// <param name="offset">The zero-based byte offset in buffer at which to begin copying bytes to the current stream.</param>\r
-               /// <param name="count">The number of bytes to be written to the current stream.</param>\r
-               /// <exception cref="NotSupportedException">This stream does not support writing.</exception>\r
-               /// <exception cref="ArgumentNullException"><paramref name="buffer" /> is a null reference.</exception>\r
-               /// <exception cref="ArgumentOutOfRangeException"><paramref name="offset" /> or <paramref name="count" /> is negative.</exception>\r
-               /// <exception cref="ArgumentException">The sum of <paramref name="offset" /> and <paramref name="count" /> is greater than the buffer length.</exception>\r
-               virtual void Write( array<System::Byte>^ buffer, int offset, int count ) override;\r
-\r
-               /// <summary>\r
-               /// Writes an array of values to the current stream, and advances the current position\r
-               /// within this stream by the number of bytes written.\r
-               /// </summary>\r
-               /// <typeparam name="T">The type of the values to be written to the stream.</typeparam>\r
-               /// <param name="data">An array of values to be written to the stream.</param>\r
-               /// <param name="offset">The zero-based offset in data at which to begin copying values to the current stream.</param>\r
-               /// <param name="count">The number of values to be written to the current stream. If this is zero,\r
-               /// all of the contents <paramref name="data" /> will be written.</param>\r
-               /// <exception cref="NotSupportedException">This stream does not support writing.</exception>\r
-               /// <exception cref="ArgumentNullException"><paramref name="data" /> is a null reference.</exception>\r
-               /// <exception cref="ArgumentOutOfRangeException"><paramref name="offset" /> or <paramref name="count" /> is negative.</exception>\r
-               /// <exception cref="ArgumentException">The sum of <paramref name="offset" /> and <paramref name="count" /> is greater than the buffer length.</exception>\r
-               generic<typename T> where T : value class\r
-               void WriteRange( array<T>^ data, int offset, int count );\r
-\r
-               /// <summary>\r
-               /// Writes an array of values to the current stream, and advances the current position\r
-               /// within this stream by the number of bytes written.\r
-               /// </summary>\r
-               /// <param name="data">An array of values to be written to the current stream.</param>\r
-               /// <exception cref="NotSupportedException">This stream does not support writing.</exception>\r
-               /// <exception cref="ArgumentNullException"><paramref name="data" /> is a null reference.</exception>\r
-               generic<typename T> where T : value class\r
-               void WriteRange( array<T>^ data ) { WriteRange( data, 0, 0 ); }\r
-               \r
-               /// <summary>\r
-               /// Writes a range of bytes to the current stream, and advances the current position\r
-               /// within this stream by the number of bytes written.\r
-               /// </summary>\r
-               /// <param name="source">A pointer to the location to start copying from.</param>\r
-               /// <param name="count">The number of bytes to copy from source to the current stream.</param>\r
-               /// <exception cref="NotSupportedException">This stream does not support writing.</exception>\r
-               /// <exception cref="ArgumentNullException"><paramref name="source" /> is a zero pointer.</exception>\r
-               /// <exception cref="ArgumentOutOfRangeException"><paramref name="count" /> is negative.</exception>\r
-               void WriteRange( System::IntPtr source, System::Int64 count );\r
-\r
-               /// <summary>\r
-               /// Reads a single value from the current stream and advances the current\r
-               /// position within this stream by the number of bytes read.\r
-               /// </summary>\r
-               /// <typeparam name="T">The type of the value to be read from the stream.</typeparam>\r
-               /// <returns>The value that was read.</returns>\r
-               /// <exception cref="NotSupportedException">This stream does not support reading.</exception>\r
-               /// <exception cref="EndOfStreamException">There is not enough space in the current\r
-               /// stream to read a value of this type.</exception>\r
-               generic<typename T> where T : value class\r
-               T Read();\r
-\r
-               /// <summary>\r
-               /// Reads a sequence of bytes from the current stream and advances the position\r
-               /// within the stream by the number of bytes read.\r
-               /// </summary>\r
-               /// <param name="buffer">An array of values to be read from the stream.</param>\r
-               /// <param name="offset">The zero-based byte offset in buffer at which to begin storing\r
-               /// the data read from the current stream.</param>\r
-               /// <param name="count">The maximum number of bytes to be read from the current stream.</param>\r
-               /// <returns>The number of bytes read from the stream.</returns>\r
-               /// <exception cref="NotSupportedException">This stream does not support reading.</exception>\r
-               /// <exception cref="ArgumentNullException"><paramref name="buffer" /> is a null reference.</exception>\r
-               /// <exception cref="ArgumentOutOfRangeException"><paramref name="offset" /> or <paramref name="count" /> is negative.</exception>\r
-               /// <exception cref="ArgumentException">The sum of <paramref name="offset" /> and <paramref name="count" /> is greater than the buffer length.</exception>\r
-               virtual int Read( array<System::Byte>^ buffer, int offset, int count ) override;\r
-\r
-               /// <summary>\r
-               /// Reads a sequence of elements from the current stream into a target buffer and\r
-               /// advances the position within the stream by the number of bytes read.\r
-               /// </summary>\r
-               /// <param name="buffer">An array of values to be read from the stream.</param>\r
-               /// <param name="offset">The zero-based byte offset in buffer at which to begin storing\r
-               /// the data read from the current stream.</param>\r
-               /// <param name="count">The number of values to be read from the current stream.</param>\r
-               /// <returns>The number of bytes read from the stream.</returns>\r
-               /// <exception cref="NotSupportedException">This stream does not support reading.</exception>\r
-               /// <exception cref="ArgumentNullException"><paramref name="buffer" /> is a null reference.</exception>\r
-               /// <exception cref="ArgumentOutOfRangeException"><paramref name="offset" /> or <paramref name="count" /> is negative.</exception>\r
-               /// <exception cref="ArgumentException">The sum of <paramref name="offset" /> and <paramref name="count" /> is greater than the buffer length.</exception>\r
-               generic<typename T> where T : value class\r
-               int ReadRange( array<T>^ buffer, int offset, int count );\r
-\r
-               /// <summary>\r
-               /// Reads an array of values from the current stream, and advances the current position\r
-               /// within this stream by the number of bytes written.\r
-               /// </summary>\r
-               /// <typeparam name="T">The type of the values to be read from the stream.</typeparam>\r
-               /// <returns>An array of values that was read from the current stream.</returns> \r
-               /// <exception cref="NotSupportedException">This stream does not support reading.</exception>\r
-               /// <exception cref="ArgumentOutOfRangeException"><paramref name="count" /> is negative.</exception>\r
-               generic<typename T> where T : value class\r
-               array<T>^ ReadRange( int count );\r
-\r
-               /// <summary>\r
-               /// Not supported.\r
-               /// </summary>\r
-               /// <exception cref="NotSupportedException">Always thrown.</exception>\r
-               virtual void Flush() override;\r
-\r
-               /// <summary>\r
-               /// Not supported.\r
-               /// </summary>\r
-               /// <param name="value">Always ignored.</param>\r
-               /// <exception cref="NotSupportedException">Always thrown.</exception>\r
-               virtual void SetLength( System::Int64 value ) override;\r
-\r
-               /// <summary>Gets a value indicating whether the current stream supports reading.</summary>\r
-               /// <value><c>true</c> if the stream supports reading; otherwise, <c>false</c>.</value>\r
-               property bool CanRead\r
-               {\r
-                       virtual bool get() override { return m_CanRead; }\r
-               }\r
-\r
-               /// <summary>Gets a value indicating whether the current stream supports seeking.</summary>\r
-               /// <value>Always <c>true</c>.</value>\r
-               property bool CanSeek\r
-               {\r
-                       virtual bool get() override { return true; }\r
-               }\r
-\r
-               /// <summary>Gets a value indicating whether the current stream supports writing.</summary>\r
-               /// <value><c>true</c> if the stream supports writing; otherwise, <c>false</c>.</value>\r
-               property bool CanWrite\r
-               {\r
-                       virtual bool get() override { return m_CanWrite; }\r
-               }\r
-\r
-               /// <summary>Gets the length in bytes of the stream.</summary>\r
-               /// <value>A long value representing the length of the stream in bytes.</value>\r
-               property System::Int64 Length\r
-               {\r
-                       virtual System::Int64 get() override;\r
-               }\r
-\r
-               /// <summary>Gets or sets the position within the current stream.</summary>\r
-               /// <value>The current position within the stream.</value>\r
-               /// <seealso cref="Stream">Stream Class</seealso>\r
-               property System::Int64 Position\r
-               {\r
-                       virtual System::Int64 get() override;\r
-                       virtual void set( System::Int64 ) override;\r
-               }\r
-\r
-               /// <summary>Gets the internal pointer to the current stream's backing store.</summary>\r
-               /// <value>An IntPtr to the buffer being used as a backing store.</value>\r
-               property System::IntPtr DataPointer\r
-               {\r
-                       System::IntPtr get() { return System::IntPtr( m_Buffer ); }\r
-               }\r
-       };\r
-}\r