IOperatingSystem.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. /*---------------------------------------------------------------------
  2. XX X XXX
  3. XX XX
  4. XXX XX XXX XXXXX XX
  5. XX XXX XX XX XX
  6. XX XX XX XX XXXXX XX
  7. XX XX XX XX XX XX X XX
  8. XXXX XX XX XXX XXXXXXX XXXX
  9. XX
  10. XXXXX
  11. Copyright (c) 2001 Intel Corporation. All Rights Reserved.
  12. CREATED: August 08, 2001
  13. OWNER: Scott D Smith, Joel Marcey
  14. VERSION: 1.0
  15. ---------------------------------------------------------------------*/
  16. using System;
  17. using System.IO;
  18. using System.Collections;
  19. namespace System.PlatformAbstractionLayer
  20. {
  21. /// <summary>
  22. /// Definition of functionality needed by the library that can only be provided by the underlying OS.
  23. /// </summary>
  24. internal interface IOperatingSystem
  25. {
  26. // System.IO services
  27. int ReadStdInput(byte[] buffer, int offset, int count);
  28. void FlushStdOutput(byte[] byteBuf);
  29. // System.File services
  30. int ReadFile(IntPtr handle, byte[] buffer, int offset, int count);
  31. int WriteFile(IntPtr handle, byte[] buffer, int offset, int count);
  32. void FlushFile(IntPtr handle, byte[] byteBuf);
  33. int SetLengthFile(IntPtr handle, long length);
  34. IntPtr OpenFile(string path, FileMode mode, FileAccess access, FileShare share);
  35. void CloseFile(IntPtr handle);
  36. long SeekFile(IntPtr handle, long offset, SeekOrigin origin);
  37. IntPtr CreateFile(string path, FileMode mode, FileAccess access, FileShare share);
  38. void DeleteFile(string path);
  39. bool ExistsFile(string path);
  40. DateTime GetCreationTimeFile(string path);
  41. DateTime GetLastAccessTimeFile(string path);
  42. DateTime GetLastWriteTimeFile(string path);
  43. void SetCreationTimeFile(string path, DateTime creationTime);
  44. void SetLastAccessTimeFile(string path, DateTime lastAccessTime);
  45. void SetLastWriteTimeFile(string path, DateTime lastWriteTime);
  46. long FileLength(string path);
  47. long FileLength(IntPtr handle);
  48. // System.Environment services
  49. string NewLineSequence {get;}
  50. char DirectorySeparator {get;}
  51. char AltDirectorySeparator {get;}
  52. char PathSeparator {get;}
  53. char VolumeSeparator {get;}
  54. char[] DirVolSeparatorChars {get;}
  55. char[] InvalidPathChars {get;}
  56. string GetEnvironmentVariable(string eVar);
  57. char ExtensionCharacter {get;}
  58. string CommandLine {get;}
  59. IDictionary EnvironmentVariables {get;}
  60. string MachineName {get;}
  61. OperatingSystem OSVersion {get;}
  62. // System.Path services
  63. // Note: Although some of these do not require direct acccess to the OS,
  64. // some platforms don't support some of these methods
  65. string ChangeExtension(string path, string extension);
  66. string GetExtension(string path);
  67. string GetFileName(string path);
  68. string GetFileNameWithoutExtension(string path);
  69. string GetPathRoot(string path);
  70. string GetTempFileName();
  71. string GetTempPath();
  72. bool HasExtension(string path);
  73. bool IsPathRooted(string path);
  74. string GetFullPath(string path);
  75. // System.Directory services
  76. void DeleteDirectory(string path, bool recursive);
  77. bool ExistsDirectory(string path);
  78. DateTime GetCreationTimeDirectory(string path);
  79. string GetCurrentDirectory();
  80. string[] GetDirectories(string path, string searchPattern);
  81. string[] GetFiles(string path, string searchPattern);
  82. string[] GetFileSystemEntries(string path, string searchPattern);
  83. DateTime GetLastAccessTimeDirectory(string path);
  84. DateTime GetLastWriteTimeDirectory(string path);
  85. void MoveDirectory(string sourceDirName, string destDirName);
  86. void SetCreationTimeDirectory(string path, DateTime creationTime);
  87. void SetCurrentDirectory(string path);
  88. void SetLastAccessTimeDirectory(string path, DateTime lastAccessTime);
  89. void SetLastWriteTimeDirectory(string path, DateTime lastWriteTime);
  90. double Acos(double d);
  91. double Asin(double d);
  92. double Atan(double d);
  93. double Atan2(double y, double x);
  94. double Cos(double d);
  95. double Cosh(double value);
  96. double Exp(dobule d);
  97. double Log(double d);
  98. double Log10(double d);
  99. double Pow(double x, double y);
  100. double Sin(double d);
  101. double Sinh(double d);
  102. double Sqrt(double d);
  103. double Tan(double d);
  104. double Tanh(double d);
  105. }
  106. }