| 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 | .Kr.\...%.2...pv..r.|.......|... |
// 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;
namespace Tango.Scripting.Editors.Utils
{
/// <summary>
/// Represents a string with a segment.
/// Similar to System.ArraySegment<T>, but for strings instead of arrays.
/// </summary>
public struct StringSegment : IEquatable<StringSegment>
{
readonly string text;
readonly int offset;
readonly int count;
/// <summary>
/// Creates a new StringSegment.
/// </summary>
public StringSegment(string text, int offset, int count)
{
if (text == null)
throw new ArgumentNullException("text");
if (offset < 0 || offset > text.Length)
throw new ArgumentOutOfRangeException("offset");
if (offset + count > text.Length)
throw new ArgumentOutOfRangeException("count");
this.text = text;
this.offset = offset;
this.count = count;
}
/// <summary>
/// Creates a new StringSegment.
/// </summary>
public StringSegment(string text)
{
if (text == null)
throw new ArgumentNullException("text");
this.text = text;
this.offset = 0;
this.count = text.Length;
}
/// <summary>
/// Gets the string used for this segment.
/// </summary>
public string Text {
get { return text; }
}
/// <summary>
/// Gets the start offset of the segment with the text.
/// </summary>
public int Offset {
get { return offset; }
}
/// <summary>
/// Gets the length of the segment.
/// </summary>
public int Count {
get { return count; }
}
#region Equals and GetHashCode implementation
/// <inheritdoc/>
public override bool Equals(object obj)
{
if (obj is StringSegment)
return Equals((StringSegment)obj); // use Equals method below
else
return false;
}
/// <inheritdoc/>
public bool Equals(StringSegment other)
{
// add comparisions for all members here
return object.ReferenceEquals(this.text, other.text) && offset == other.offset && count == other.count;
}
/// <inheritdoc/>
public override int GetHashCode()
{
return text.GetHashCode() ^ offset ^ count;
}
/// <summary>
/// Equality operator.
/// </summary>
public static bool operator ==(StringSegment left, StringSegment right)
{
return left.Equals(right);
}
/// <summary>
/// Inequality operator.
/// </summary>
public static bool operator !=(StringSegment left, StringSegment right)
{
return !left.Equals(right);
}
#endregion
}
}
|