mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-11 10:41:33 +00:00
added some file types
This commit is contained in:
parent
e1220c7586
commit
dd8ce3cffa
4 changed files with 47 additions and 2 deletions
|
|
@ -40,8 +40,10 @@
|
|||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="File.cs" />
|
||||
<Compile Include="IFile.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Windows\File.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
|
|
|||
24
source/Cosmos.Kernel.FileSystems/File.cs
Normal file
24
source/Cosmos.Kernel.FileSystems/File.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Cosmos.Kernel.FileSystems
|
||||
{
|
||||
/// <summary>
|
||||
/// Static utility class that wraps the underlaying filesystem.
|
||||
/// </summary>
|
||||
public static class File
|
||||
{
|
||||
private static IFile _file;
|
||||
|
||||
public static void SetFileSystem(IFile fileSystem)
|
||||
{
|
||||
_file = fileSystem;
|
||||
}
|
||||
|
||||
public static bool Exists(string path)
|
||||
{
|
||||
return _file.Exists(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,8 @@ using System.Text;
|
|||
|
||||
namespace Cosmos.Kernel.FileSystems
|
||||
{
|
||||
public class Class1
|
||||
public interface IFile
|
||||
{
|
||||
bool Exists(string path);
|
||||
}
|
||||
}
|
||||
18
source/Cosmos.Kernel.FileSystems/Windows/File.cs
Normal file
18
source/Cosmos.Kernel.FileSystems/Windows/File.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Cosmos.Kernel.FileSystems.Windows
|
||||
{
|
||||
/// <summary>
|
||||
/// Implementation of operations on the Windows file system.
|
||||
/// </summary>
|
||||
public class File : IFile
|
||||
{
|
||||
public bool Exists(string path)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue