From: handa Date: Tue, 6 Jan 2009 10:23:10 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=5d786675667099a49d970cc6470f56781a426d50;p=m17n%2Fm17n-lib-cs.git *** empty log message *** --- diff --git a/MText.cs b/MText.cs index 7b7a9d5..ecc24eb 100644 --- a/MText.cs +++ b/MText.cs @@ -94,7 +94,11 @@ namespace M17N.Core public static MText operator+ (MText mt1, MText mt2) { - return new MText (mt1.sb + mt2.sb); + MText mt = new MText (mt1.sb); + + mt.sb.Append (mt2.sb); + mt.nchars = mt1.nchars + mt2.nchars; + return mt; } private static bool surrogate_high_p (char c) @@ -161,6 +165,15 @@ namespace M17N.Core return i; } + private readonly bool readonlyp; + + private void insert (int pos, MText mt2, int from, int to) + { + if (pos != cache_pos) + pos = pos_to_idx (pos); + + } + public int this[int i] { set { @@ -187,6 +200,23 @@ namespace M17N.Core : sb[i]); } } + + public MText dup () + { + return (new MText (this.sb)); + } + + public MText ins (int pos, MText mt) + { + insert (pos, mt, 0, mt.nchars); + return this; + } + + public MText ins (int pos, MText mt, int from, int to) + { + insert (pos, mt, from, to); + return this; + } } public class MTextProperty