3 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
5 // Permission is hereby granted, free of charge, to any person obtaining
6 // a copy of this software and associated documentation files (the
7 // "Software"), to deal in the Software without restriction, including
8 // without limitation the rights to use, copy, modify, merge, publish,
9 // distribute, sublicense, and/or sell copies of the Software, and to
10 // permit persons to whom the Software is furnished to do so, subject to
11 // the following conditions:
13 // The above copyright notice and this permission notice shall be
14 // included in all copies or substantial portions of the Software.
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 /*---------------------------------------------------------------------
31 XX XX XX XX XX XX X XX
32 XXXX XX XX XXX XXXXXXX XXXX
36 Copyright (c) 2001 Intel Corporation. All Rights Reserved.
38 CREATED: August 08, 2001
39 OWNER: Scott D Smith, Joel Marcey
41 ---------------------------------------------------------------------*/
46 using System
.Collections
;
48 namespace System
.PlatformAbstractionLayer
51 /// Definition of functionality needed by the library that can only be provided by the underlying OS.
53 internal interface IOperatingSystem
58 int ReadStdInput(byte[] buffer
, int offset
, int count
);
60 void FlushStdOutput(byte[] byteBuf
);
64 // System.File services
66 int ReadFile(IntPtr handle
, byte[] buffer
, int offset
, int count
);
68 int WriteFile(IntPtr handle
, byte[] buffer
, int offset
, int count
);
70 void FlushFile(IntPtr handle
, byte[] byteBuf
);
72 int SetLengthFile(IntPtr handle
, long length
);
74 IntPtr
OpenFile(string path
, FileMode mode
, FileAccess access
, FileShare share
);
76 void CloseFile(IntPtr handle
);
78 long SeekFile(IntPtr handle
, long offset
, SeekOrigin origin
);
80 IntPtr
CreateFile(string path
, FileMode mode
, FileAccess access
, FileShare share
);
82 void DeleteFile(string path
);
84 bool ExistsFile(string path
);
86 DateTime
GetCreationTimeFile(string path
);
88 DateTime
GetLastAccessTimeFile(string path
);
90 DateTime
GetLastWriteTimeFile(string path
);
92 void SetCreationTimeFile(string path
, DateTime creationTime
);
94 void SetLastAccessTimeFile(string path
, DateTime lastAccessTime
);
96 void SetLastWriteTimeFile(string path
, DateTime lastWriteTime
);
98 long FileLength(string path
);
100 long FileLength(IntPtr handle
);
103 // System.Environment services
105 string NewLineSequence {get;}
107 char DirectorySeparator {get;}
109 char AltDirectorySeparator {get;}
111 char PathSeparator {get;}
113 char VolumeSeparator {get;}
115 char[] DirVolSeparatorChars {get;}
117 char[] InvalidPathChars {get;}
119 string GetEnvironmentVariable(string eVar
);
121 char ExtensionCharacter {get;}
123 string CommandLine {get;}
125 IDictionary EnvironmentVariables {get;}
127 string MachineName {get;}
129 OperatingSystem OSVersion {get;}
131 // System.Path services
132 // Note: Although some of these do not require direct acccess to the OS,
133 // some platforms don't support some of these methods
135 string ChangeExtension(string path
, string extension
);
137 string GetExtension(string path
);
139 string GetFileName(string path
);
141 string GetFileNameWithoutExtension(string path
);
143 string GetPathRoot(string path
);
145 string GetTempFileName();
147 string GetTempPath();
149 bool HasExtension(string path
);
151 bool IsPathRooted(string path
);
153 string GetFullPath(string path
);
156 // System.Directory services
158 void DeleteDirectory(string path
, bool recursive
);
160 bool ExistsDirectory(string path
);
162 DateTime
GetCreationTimeDirectory(string path
);
164 string GetCurrentDirectory();
166 string[] GetDirectories(string path
, string searchPattern
);
168 string[] GetFiles(string path
, string searchPattern
);
170 string[] GetFileSystemEntries(string path
, string searchPattern
);
172 DateTime
GetLastAccessTimeDirectory(string path
);
174 DateTime
GetLastWriteTimeDirectory(string path
);
176 void MoveDirectory(string sourceDirName
, string destDirName
);
178 void SetCreationTimeDirectory(string path
, DateTime creationTime
);
180 void SetCurrentDirectory(string path
);
182 void SetLastAccessTimeDirectory(string path
, DateTime lastAccessTime
);
184 void SetLastWriteTimeDirectory(string path
, DateTime lastWriteTime
);
186 double Acos(double d
);
188 double Asin(double d
);
190 double Atan(double d
);
192 double Atan2(double y
, double x
);
194 double Cos(double d
);
196 double Cosh(double value);
198 double Exp(dobule d
);
200 double Log(double d
);
202 double Log10(double d
);
204 double Pow(double x
, double y
);
206 double Sin(double d
);
208 double Sinh(double d
);
210 double Sqrt(double d
);
212 double Tan(double d
);
214 double Tanh(double d
);