| ofs | hex dump | ascii |
|---|
| 0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 01 0e 00 00 01 0e 08 06 00 00 00 78 b1 f9 | .PNG........IHDR.............x.. |
| 0020 | a5 00 00 02 ff 69 43 43 50 49 43 43 20 50 72 6f 66 69 6c 65 00 00 78 9c 8d 54 cd 4f 13 41 14 7f | .....iCCPICC.Profile..x..T.O.A.. |
| 0040 | 2d cb 62 02 f1 22 22 36 c6 6c 3c 68 63 80 2c 68 14 62 44 5b 5a 9a 02 d6 a6 7c 08 c4 c4 6c b7 d3 | -.b..""6.l<hc.,h.bD[Z....|...l.. |
| 0060 | 76 65 bb 5d 67 b7 e5 23 1c 0c 17 6f 8a c6 bb f1 23 9e fc 03 88 e1 e0 8d 93 81 84 a0 31 21 9e 35 | ve.]g..#...o....#...........1!.5 |
| 0080 | 46 63 82 e1 62 b0 be d9 0f 76 51 fc 98 64 76 7e f3 de 6f 7e ef cd 9b 9d 01 a8 7f 28 e9 ba 1a 14 | Fc..b....vQ..dv~..o~.......(.... |
| 00a0 | 00 4a 9a 49 33 89 a8 30 3e 31 29 34 bc 83 20 1c 85 46 08 41 a3 24 1b 7a 24 9d 1e 02 6c 8c 0b bf | .J.I3..0>1)4.....F.A.$.z$...l... |
| 00c0 | b5 ed 37 10 60 e3 7a fb fe fe bf b6 c6 1c 31 64 80 c0 01 c4 e5 9c 21 97 10 cf 00 d4 8d c9 3a 35 | ..7.`.z.......1d......!.......:5 |
| 00e0 | 01 b8 35 b4 77 4f 9b 3a e2 7a c6 69 a6 98 20 e2 63 0c 17 6c 2c 32 9c b5 71 cc e2 8c 64 fa 10 8f | ..5.wO.:.z.i....c..l,2..q...d... |
| 0100 | 23 3e 28 17 a5 1c e2 22 e2 b6 ac cf 5e f0 61 3b 07 ab 35 27 88 46 a8 22 0b ac 16 69 5a ce 2b 2a | #>(...."....^.a;..5'.F."...iZ.+* |
| 0120 | f1 a5 fb 0f f7 7f b6 92 5a 71 e3 1d c2 de a4 9b d1 0c 8e 27 b1 7f cb d3 fe 51 1c c3 58 87 d0 5c | ........Zq.........'.....Q..X..\ |
| 0140 | 71 e4 1a e2 16 c4 51 c5 4c 8e 38 f6 71 2d 9b ba 6a f3 03 b7 a7 ca 83 19 87 f3 3c 47 62 71 b6 4f | q.....Q.L.8.q-..j.........<Gbq.O |
| 0160 | c4 cb 46 75 38 ee 72 e6 8a 7d 29 87 f3 e1 a6 34 90 46 1c 42 fc 43 37 d3 8e 4e b0 55 53 53 43 b6 | ..Fu8.r..})....4.F.B.C7..N.USSC. |
| 0180 | 7e b0 97 18 f1 61 d7 9e 57 fa 93 8e 3d af ab d6 7f 80 fa c1 bb b4 92 61 79 9e 40 fc 52 a2 f1 84 | ~....a..W...=..........ay.@.R... |
| 01a0 | c3 df 24 da a8 b3 b6 2e 98 93 62 83 88 3b 10 87 21 0d 04 28 e4 41 01 15 04 c8 40 02 a2 38 26 d0 | ..$.......b..;..!..(.A....@..8&. |
| 01c0 | aa c1 47 f4 28 20 43 19 59 14 bf 2e ab 80 1e d7 7b 0b 2a c8 65 2b c7 20 ba 18 aa 84 3d 95 05 7a | ..G.(.C.Y.......{.*.e+......=..z |
| 01e0 | 43 91 57 ef 7d dd b3 ba ec 8b 52 b0 a2 90 dd 28 09 df dc 80 a9 5d 66 3b e8 9e c2 ca fc 72 ab a7 | C.W.}.....R....(.....]f;.....r.. |
| 0200 | b1 c1 2d 5d 5f 6f 5a 99 87 08 6a ab 96 62 09 bb 62 e9 18 3e 05 5f 0e 79 6d 31 e4 29 b0 0c c9 9d | ..-]_oZ...j..b..b..>._.ym1.).... |
| 0220 | d4 76 0a 16 da 3c ab f8 56 fc 2c 6e 88 8f c5 67 e2 a7 3f d4 a8 f0 4b 8d 22 be f8 cc b3 5f f6 04 | .v...<..V.,n...g..?...K."...._.. |
| 0240 | 39 13 d8 dd 0c f7 67 b1 38 0a 8c a2 57 81 69 2b b6 01 12 da 34 98 45 be be e7 2c ac d5 dc 71 ae | 9.....g.8...W.i+....4.E...,...q. |
| 0260 | 93 4b 72 dd 5c 0f 08 dc 25 ee 32 d7 cb c5 70 76 81 1b 72 19 7c 9c 8f f1 11 10 f8 d3 7c 0f df c9 | pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
namespace Tango.Scripting.Editors.Utils
{
/// <summary>
/// TextReader implementation that reads text from a rope.
/// </summary>
public sealed class RopeTextReader : TextReader
{
Stack<RopeNode<char>> stack = new Stack<RopeNode<char>>();
RopeNode<char> currentNode;
int indexInsideNode;
/// <summary>
/// Creates a new RopeTextReader.
/// Internally, this method creates a Clone of the rope; so the text reader will always read through the old
/// version of the rope if it is modified. <seealso cref="Rope{T}.Clone()"/>
/// </summary>
public RopeTextReader(Rope<char> rope)
{
if (rope == null)
throw new ArgumentNullException("rope");
// We force the user to iterate through a clone of the rope to keep the API contract of RopeTextReader simple
// (what happens when a rope is modified while iterating through it?)
rope.root.Publish();
// special case for the empty rope:
// leave currentNode initialized to null (RopeTextReader doesn't support empty nodes)
if (rope.Length != 0) {
currentNode = rope.root;
GoToLeftMostLeaf();
}
}
void GoToLeftMostLeaf()
{
while (currentNode.contents == null) {
if (currentNode.height == 0) {
// this is a function node - move to its contained rope
currentNode = currentNode.GetContentNode();
continue;
}
Debug.Assert(currentNode.right != null);
stack.Push(currentNode.right);
currentNode = currentNode.left;
}
Debug.Assert(currentNode.height == 0);
}
/// <inheritdoc/>
public override int Peek()
{
if (currentNode == null)
return -1;
return currentNode.contents[indexInsideNode];
}
/// <inheritdoc/>
public override int Read()
{
if (currentNode == null)
return -1;
char result = currentNode.contents[indexInsideNode++];
if (indexInsideNode >= currentNode.length)
GoToNextNode();
return result;
}
void GoToNextNode()
{
if (stack.Count == 0) {
currentNode = null;
} else {
indexInsideNode = 0;
currentNode = stack.Pop();
GoToLeftMostLeaf();
}
}
/// <inheritdoc/>
public override int Read(char[] buffer, int index, int count)
{
if (currentNode == null)
return 0;
int amountInCurrentNode = currentNode.length - indexInsideNode;
if (count < amountInCurrentNode) {
Array.Copy(currentNode.contents, indexInsideNode, buffer, index, count);
indexInsideNode += count;
return count;
} else {
// read to end of current node
Array.Copy(currentNode.contents, indexInsideNode, buffer, index, amountInCurrentNode);
GoToNextNode();
return amountInCurrentNode;
}
}
}
}
|