X-Git-Url: http://git.phpeclipse.com diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/category/ParseCategory.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/category/ParseCategory.java new file mode 100644 index 0000000..6bfb884 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/actions/category/ParseCategory.java @@ -0,0 +1,223 @@ +package net.sourceforge.phpeclipse.wiki.actions.category; + +import java.util.ArrayList; + +public class ParseCategory { + ArrayList titleList; + + public ParseCategory() { + titleList = new ArrayList(); + } + public void parseCategory(String text) { + int index1 = text.indexOf("contentSub"); + int index2 = text.indexOf("printfooter"); + if (index2 < 0) { + index2 = text.length(); + } + if (index1 > 0 && index2 > index1) { + try { + int i = index1; + int titleStart; + int titleEnd; + char ch; + while (true) { + ch = text.charAt(i++); + if (i>index2) { + break; + } + if (ch == 't' && text.charAt(i) == 'i' && text.charAt(i +1) == 't' && text.charAt(i + 2) == 'l' + && text.charAt(i + 3) == 'e') { + i += 4; + titleStart = -1; + +// found: "title" + while (true) { + ch = text.charAt(i++); + if (ch=='"') { + if (titleStart>0) { + titleList.add(text.substring(titleStart,i-1)); + break; + } + titleStart = i; + } + } + + } + } + } catch (IndexOutOfBoundsException e) { + + } + + } + } + + public static void main(String[] args) { + String test = "\r\n" + + "\r\n" + + "
\r\n" + + " \r\n" + + " \r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "(Dieser Artikel enthält momentan keinen Text)
\r\n"
+ + "