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