From 94b85e1fad1ca53b56fa1e1d41c5627849603b27 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 20 May 2002 07:34:07 +0000 Subject: Added a Match method to Accessor to make it easy to check for strings in a document. Moved IsASpaceOrTab into StyleContext header. --- src/DocumentAccessor.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/DocumentAccessor.cxx') diff --git a/src/DocumentAccessor.cxx b/src/DocumentAccessor.cxx index f115f1930..595edf8ba 100644 --- a/src/DocumentAccessor.cxx +++ b/src/DocumentAccessor.cxx @@ -48,6 +48,15 @@ void DocumentAccessor::Fill(int position) { buf[endPos-startPos] = '\0'; } +bool DocumentAccessor::Match(int pos, const char *s) { + for (int i=0; *s; i++) { + if (*s != SafeGetCharAt(pos+i)) + return false; + s++; + } + return true; +} + char DocumentAccessor::StyleAt(int position) { return pdoc->StyleAt(position); } -- cgit v1.2.3