Mercurial > pub > ImplabNet
annotate Implab/Formats/StringScanner.cs @ 196:40d7fed4a09e
fixed promise chaining behavior, the error handler doesn't handle result or cancellation handlers exceptions these exceptions are propagated to the next handlers.
| author | cin |
|---|---|
| date | Mon, 29 Aug 2016 23:15:51 +0300 |
| parents | 76e8f2ba12b8 |
| children |
| rev | line source |
|---|---|
| 176 | 1 using System; |
| 2 | |
| 3 namespace Implab.Formats { | |
| 4 public class StringScanner: TextScanner { | |
| 5 const int CHUNK_SIZE = 1024; | |
| 6 | |
| 182 | 7 public StringScanner(string text) : base(null) { |
| 8 Safe.ArgumentNotNull(text, "text"); | |
| 9 var data = text.ToCharArray(); | |
| 10 Feed(data, 0, data.Length); | |
| 176 | 11 } |
| 12 | |
| 13 protected override int Read(char[] buffer, int offset, int size) { | |
| 182 | 14 return 0; |
| 176 | 15 } |
| 16 } | |
| 17 } | |
| 18 |
