Adding GetStream(FileMode) to get the stream of a file

This commit is contained in:
Nathan Adams 2012-05-12 18:36:46 -05:00
parent f152fc2978
commit e74c663c02
6 changed files with 32 additions and 0 deletions

View File

@ -72,6 +72,7 @@
* - Adding support for Gleed2D
* - Splitting the code for Gleed2D into seperate files
* - Adding a cache for loading in textures for Gleed2D
* - Adding GetStream(FileMode) to get the stream of a file
*
*/

View File

@ -28,5 +28,10 @@ namespace Axios.Engine.File
{
throw new NotImplementedException();
}
public virtual FileStream GetStream(FileMode mode)
{
throw new NotImplementedException();
}
}
}

View File

@ -50,5 +50,18 @@ namespace Axios.Engine.File
Content = ret;
return ret;
}
public override FileStream GetStream(FileMode mode)
{
#if WINDOWS
IsolatedStorageFile savegameStorage = IsolatedStorageFile.GetUserStoreForDomain();
#else
IsolatedStorageFile savegameStorage = IsolatedStorageFile.GetUserStoreForApplication();
#endif
IsolatedStorageFileStream fs = null;
fs = savegameStorage.OpenFile(_filename, mode);
return fs;
}
}
}

View File

@ -36,5 +36,11 @@ namespace Axios.Engine.File
sr.Close();
return ret;
}
public override FileStream GetStream(FileMode mode)
{
FileStream fs = new FileStream(_filename, mode);
return fs;
}
}
}

View File

@ -27,5 +27,11 @@ namespace Axios.Engine.File
sr.Close();
return this.Content;
}
public override FileStream GetStream(FileMode mode)
{
FileStream fs = (FileStream)TitleContainer.OpenStream(_filename);
return fs;
}
}
}

View File

@ -6,5 +6,6 @@ namespace Axios.Engine.Interfaces
{
void WriteData(string data, FileMode mode);
string ReadData();
FileStream GetStream(FileMode mode);
}
}