diff options
author | Zoltan Varga <vargaz@gmail.com> | 2006-04-21 17:48:25 +0400 |
---|---|---|
committer | Zoltan Varga <vargaz@gmail.com> | 2006-04-21 17:48:25 +0400 |
commit | 8aa7e045770e854963374735d4d71888de75e5cd (patch) | |
tree | b1cf50218e2ec3c6ec6e7901e32f56d2f7a6ac19 /mcs | |
parent | 363e181509772ecadaaa1ee1eae1a7f316c52ebb (diff) | |
parent | f09ac378d3a28c0e06de77df1d1fcdae24529f07 (diff) |
2006-04-21 Zoltan Varga <vargaz@gmail.com>
* FileStream.cs: Add new net 2.0 ctor.
* FileOptions.cs: New file.
svn path=/branches/mono-1-1-13/mcs/; revision=59753
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/corlib/System.IO/ChangeLog | 6 | ||||
-rw-r--r-- | mcs/class/corlib/System.IO/FileOptions.cs | 56 | ||||
-rw-r--r-- | mcs/class/corlib/System.IO/FileStream.cs | 17 |
3 files changed, 79 insertions, 0 deletions
diff --git a/mcs/class/corlib/System.IO/ChangeLog b/mcs/class/corlib/System.IO/ChangeLog index 85e970e941b..a37f4d5c4ee 100644 --- a/mcs/class/corlib/System.IO/ChangeLog +++ b/mcs/class/corlib/System.IO/ChangeLog @@ -1,3 +1,9 @@ +2006-04-21 Zoltan Varga <vargaz@gmail.com> + + * FileStream.cs: Add new net 2.0 ctor. + + * FileOptions.cs: New file. + 2006-03-21 Gonzalo Paniagua Javier <gonzalo@ximian.com> * FileStream.cs: Seek() should flush the buffer, if any. Fixes bug diff --git a/mcs/class/corlib/System.IO/FileOptions.cs b/mcs/class/corlib/System.IO/FileOptions.cs new file mode 100644 index 00000000000..3b9dd6dadab --- /dev/null +++ b/mcs/class/corlib/System.IO/FileOptions.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// +// System.IO.FileOptions.cs +// +// Author: Zoltan Varga (vargaz@gmail.com) +// +//------------------------------------------------------------------------------ + +// +// Copyright (C) 2004 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System.Runtime.InteropServices; + +namespace System.IO +{ + [Flags] + [Serializable] + [ComVisible(true)] + [MonoTODO] +#if NET_2_0 + public enum FileOptions +#else + internal enum FileOptions +#endif + { + None = 0, + Encrypted = 0x4000, + DeleteOnClose = 0x4000000, + SequentialScan = 0x8000000, + RandomAccess = 0x10000000, + Asynchronous = 0x40000000, + // FIXME: This field cannot be encoded as an int in C# + //WriteThrough = 0x80000000 + } +} + diff --git a/mcs/class/corlib/System.IO/FileStream.cs b/mcs/class/corlib/System.IO/FileStream.cs index 15c7255df33..92465651e86 100644 --- a/mcs/class/corlib/System.IO/FileStream.cs +++ b/mcs/class/corlib/System.IO/FileStream.cs @@ -132,7 +132,19 @@ namespace System.IO { } +#if NET_2_0 + public FileStream (string name, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options) + : this (name, mode, access, share, bufferSize, false, false, options) + { + } +#endif + internal FileStream (string name, FileMode mode, FileAccess access, FileShare share, int bufferSize, bool isAsync, bool anonymous) + : this (name, mode, access, share, bufferSize, isAsync, anonymous, FileOptions.None) + { + } + + internal FileStream (string name, FileMode mode, FileAccess access, FileShare share, int bufferSize, bool isAsync, bool anonymous, FileOptions options) { if (name == null) { throw new ArgumentNullException ("name"); @@ -142,6 +154,11 @@ namespace System.IO throw new ArgumentException ("Name is empty"); } +#if NET_2_0 + if (options != FileOptions.None) + throw new NotImplementedException ("Only FileOptions.None is supported."); +#endif + if (bufferSize <= 0) throw new ArgumentOutOfRangeException ("Positive number required."); |