Merge branch 'master' of http://github.com/mono/mono
[mono.git] / mcs / class / corlib / System.PAL / IOperatingSystem.cs
1 \r
2 //\r
3 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)\r
4 //\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
12 // \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
15 // \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
23 //\r
24 /*---------------------------------------------------------------------\r
25 \r
26                  XX                X                XXX\r
27                                   XX                 XX\r
28                 XXX     XX XXX   XXXXX               XX\r
29                  XX     XXX XX    XX                 XX\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
33                                          XX\r
34                                           XXXXX\r
35 \r
36 Copyright (c) 2001 Intel Corporation.  All Rights Reserved.\r
37 \r
38 CREATED: August 08, 2001\r
39 OWNER: Scott D Smith, Joel Marcey\r
40 VERSION: 1.0\r
41 ---------------------------------------------------------------------*/\r
42             \r
43 \r
44 using System;\r
45 using System.IO;\r
46 using System.Collections;\r
47 \r
48 namespace System.PlatformAbstractionLayer\r
49 {\r
50         /// <summary>\r
51         ///     Definition of functionality needed by the library that can only be provided by the underlying OS. \r
52         /// </summary>\r
53         internal interface IOperatingSystem\r
54         {\r
55         \r
56                 // System.IO services\r
57         \r
58                 int ReadStdInput(byte[] buffer, int offset, int count);\r
59 \r
60                 void FlushStdOutput(byte[] byteBuf);\r
61 \r
62 \r
63 \r
64                 //  System.File services\r
65 \r
66                 int ReadFile(IntPtr handle, byte[] buffer, int offset, int count);\r
67 \r
68                 int WriteFile(IntPtr handle, byte[] buffer, int offset, int count);\r
69         \r
70                 void FlushFile(IntPtr handle, byte[] byteBuf);\r
71         \r
72                 int SetLengthFile(IntPtr handle, long length);\r
73 \r
74                 IntPtr OpenFile(string path, FileMode mode, FileAccess access, FileShare share);\r
75         \r
76                 void CloseFile(IntPtr handle);\r
77         \r
78                 long SeekFile(IntPtr handle, long offset, SeekOrigin origin);\r
79         \r
80                 IntPtr CreateFile(string path, FileMode mode, FileAccess access, FileShare share);\r
81         \r
82                 void DeleteFile(string path);\r
83         \r
84                 bool ExistsFile(string path);\r
85         \r
86                 DateTime GetCreationTimeFile(string path);\r
87         \r
88                 DateTime GetLastAccessTimeFile(string path);\r
89         \r
90                 DateTime GetLastWriteTimeFile(string path);\r
91         \r
92                 void SetCreationTimeFile(string path, DateTime creationTime);\r
93         \r
94                 void SetLastAccessTimeFile(string path, DateTime lastAccessTime);\r
95         \r
96                 void SetLastWriteTimeFile(string path, DateTime lastWriteTime);\r
97 \r
98                 long FileLength(string path);\r
99 \r
100                 long FileLength(IntPtr handle);\r
101         \r
102 \r
103                 //  System.Environment services\r
104                 \r
105                 string NewLineSequence {get;}\r
106         \r
107                 char DirectorySeparator {get;}\r
108         \r
109                 char AltDirectorySeparator {get;}\r
110         \r
111                 char PathSeparator {get;}\r
112         \r
113                 char VolumeSeparator {get;}\r
114         \r
115                 char[] DirVolSeparatorChars {get;}\r
116         \r
117                 char[] InvalidPathChars {get;}\r
118         \r
119                 string GetEnvironmentVariable(string eVar);\r
120         \r
121                 char ExtensionCharacter {get;}\r
122 \r
123                 string CommandLine {get;}\r
124 \r
125                 IDictionary EnvironmentVariables {get;}\r
126 \r
127                 string MachineName {get;}\r
128         \r
129                 OperatingSystem OSVersion {get;}\r
130 \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
134         \r
135                 string ChangeExtension(string path, string extension);\r
136         \r
137                 string GetExtension(string path);\r
138        \r
139                 string GetFileName(string path);\r
140         \r
141                 string GetFileNameWithoutExtension(string path);\r
142         \r
143                 string GetPathRoot(string path);\r
144         \r
145                 string GetTempFileName();\r
146         \r
147                 string GetTempPath();\r
148         \r
149                 bool HasExtension(string path);\r
150         \r
151                 bool IsPathRooted(string path);\r
152         \r
153                 string GetFullPath(string path);\r
154         \r
155         \r
156                 //  System.Directory services\r
157         \r
158                 void DeleteDirectory(string path, bool recursive);\r
159         \r
160                 bool ExistsDirectory(string path);\r
161         \r
162                 DateTime GetCreationTimeDirectory(string path);\r
163         \r
164                 string GetCurrentDirectory();\r
165         \r
166                 string[] GetDirectories(string path, string searchPattern);\r
167         \r
168                 string[] GetFiles(string path, string searchPattern);\r
169         \r
170                 string[] GetFileSystemEntries(string path, string searchPattern);\r
171         \r
172                 DateTime GetLastAccessTimeDirectory(string path);\r
173         \r
174                 DateTime GetLastWriteTimeDirectory(string path);\r
175         \r
176                 void MoveDirectory(string sourceDirName, string destDirName);\r
177         \r
178                 void SetCreationTimeDirectory(string path, DateTime creationTime);\r
179         \r
180                 void SetCurrentDirectory(string path);\r
181         \r
182                 void SetLastAccessTimeDirectory(string path, DateTime lastAccessTime);\r
183         \r
184                 void SetLastWriteTimeDirectory(string path, DateTime lastWriteTime);\r
185 \r
186                 double Acos(double d);\r
187 \r
188                 double Asin(double d);\r
189 \r
190                 double Atan(double d);\r
191 \r
192                 double Atan2(double y, double x);\r
193 \r
194                 double Cos(double d);\r
195 \r
196                 double Cosh(double value);\r
197 \r
198                 double Exp(dobule d);\r
199 \r
200                 double Log(double d);\r
201 \r
202                 double Log10(double d);\r
203 \r
204                 double Pow(double x, double y);\r
205 \r
206                 double Sin(double d);\r
207 \r
208                 double Sinh(double d);\r
209 \r
210                 double Sqrt(double d);\r
211 \r
212                 double Tan(double d);\r
213 \r
214                 double Tanh(double d);\r
215                 \r
216         }\r
217 }\r