OSDN Git Service

行を生成するメソッドをLineToIndexTableに移動した
[fooeditengine/FooEditEngine.git] / Core / StringBuffer.cs
index 58953ef..d96cc5e 100644 (file)
@@ -76,49 +76,6 @@ namespace FooEditEngine
             return temp.ToString();
         }
 
-        public IEnumerable<string> GetLines(int startIndex, int endIndex, int maxCharCount = -1)
-        {
-            foreach (Tuple<int, int> range in this.ForEachLines(startIndex, endIndex, maxCharCount))
-            {
-                StringBuilder temp = new StringBuilder();
-                temp.Clear();
-                int lineEndIndex = range.Item1;
-                if (range.Item2 > 0)
-                    lineEndIndex += range.Item2 - 1;
-                for (int i = range.Item1; i <= lineEndIndex; i++)
-                    temp.Append(buf[i]);
-                yield return temp.ToString();
-            }
-        }
-
-        public IEnumerable<Tuple<int, int>> ForEachLines(int startIndex, int endIndex, int maxCharCount = -1)
-        {
-            int currentLineHeadIndex = startIndex;
-            int currentLineLength = 0;
-
-            for (int i = startIndex; i <= endIndex; i++)
-            {
-                currentLineLength++;
-                char c = this.buf[i];
-                if (c == Document.NewLine ||
-                    (maxCharCount != -1 && currentLineLength >= maxCharCount))
-                {
-                    UnicodeCategory uc = CharUnicodeInfo.GetUnicodeCategory(c);
-                    if (uc != UnicodeCategory.NonSpacingMark &&
-                    uc != UnicodeCategory.SpacingCombiningMark &&
-                    uc != UnicodeCategory.EnclosingMark &&
-                    uc != UnicodeCategory.Surrogate)
-                    {
-                        yield return new Tuple<int, int>(currentLineHeadIndex, currentLineLength);
-                        currentLineHeadIndex += currentLineLength;
-                        currentLineLength = 0;
-                    }
-                }
-            }
-            if (currentLineLength > 0)
-                yield return new Tuple<int, int>(currentLineHeadIndex, currentLineLength);
-        }
-
         public int Length
         {
             get { return this.buf.Count; }