Mercurial > repos > IBBoard.WarFoundry.API
annotate api/Factories/Xml/Zip/StringZipEntrySource.cs @ 226:c931684f9024
Re #234: Invalid data file doesn't stop load
* Add internal methods to remove game systems or races that fail to load
* Add error handling on XML CompleteLoading so that game system or race is removed, but make sure not to affect error
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 19 Dec 2009 15:40:50 +0000 |
parents | b04512847424 |
children |
rev | line source |
---|---|
127
b04512847424
* Fix licensing error highlighted by Ohloh analysis
IBBoard <dev@ibboard.co.uk>
parents:
105
diff
changeset
|
1 // This file (StringZipEntrySource.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2009 IBBoard |
105 | 2 // |
127
b04512847424
* Fix licensing error highlighted by Ohloh analysis
IBBoard <dev@ibboard.co.uk>
parents:
105
diff
changeset
|
3 // The library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. |
b04512847424
* Fix licensing error highlighted by Ohloh analysis
IBBoard <dev@ibboard.co.uk>
parents:
105
diff
changeset
|
4 |
105 | 5 |
6 using System; | |
7 using System.IO; | |
8 using IBBoard.Lang; | |
9 using ICSharpCode.SharpZipLib.Zip; | |
10 | |
11 namespace IBBoard.WarFoundry.API.Factories.Xml.Zip | |
12 { | |
13 /// <summary> | |
14 /// A simple implementation of IStaticDataSource that lets us add a string directly to a Zip file | |
15 /// </summary> | |
16 public class StringZipEntrySource : IStaticDataSource | |
17 { | |
18 private byte[] entryContent; | |
19 | |
20 public StringZipEntrySource(String content) | |
21 { | |
22 entryContent = StringManipulation.StringToBytes(content); | |
23 } | |
24 | |
25 public Stream GetSource() | |
26 { | |
27 return new MemoryStream(entryContent); | |
28 } | |
29 } | |
30 } |