Mercurial > repos > IBDev-IBBoard.WarFoundry.API
annotate api/Factories/Xml/Zip/StringZipEntrySource.cs @ 128:45a9452579a2
Fixes #50: Complete core loading of WarFoundry XML files
* Add exceptions on invalid data - completes WarFoundry 0.1 loading needs
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Wed, 26 Aug 2009 18:37:55 +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 } |