Changeset 443 for todo/trunk/util
- Timestamp:
- 06/28/07 07:07:14 (2 years ago)
- Files:
-
- todo/trunk/util/Makefile.am (modified) (1 diff)
- todo/trunk/util/Regex.h (modified) (1 diff)
- todo/trunk/util/Strings.cc (modified) (1 diff)
- todo/trunk/util/XML.cc (modified) (2 diffs)
- todo/trunk/util/XML.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
todo/trunk/util/Makefile.am
r290 r443 1 1 noinst_LTLIBRARIES=libutil.la 2 libutil_la_SOURCES= c_regex.c c_regex.hTerminal.cc Terminal.h Lexer.cc Lexer.h \2 libutil_la_SOURCES=Terminal.cc Terminal.h Lexer.cc Lexer.h \ 3 3 Regex.cc Regex.h XML.cc XML.h Strings.cc Strings.h CommandArgs.cc CommandArgs.h 4 4 todo/trunk/util/Regex.h
r290 r443 10 10 #include <cassert> 11 11 #include <sys/types.h> 12 #include "c_regex.h"12 #include <regex.h> 13 13 14 14 #ifndef CRASH_REGEX_CACHE_THRESHOLD todo/trunk/util/Strings.cc
r290 r443 97 97 string replace(string const &match, string const &repl, string const &in) { 98 98 string out; 99 unsignedfound = 0, lastfound = 0;99 string::size_type found = 0, lastfound = 0; 100 100 101 101 while ((found = in.find(match, found)) != string::npos) { todo/trunk/util/XML.cc
r340 r443 37 37 Lexer::iterator i = xmlScan.begin(str); 38 38 39 if (i.type() == XmlDecl) { 40 ++i; 41 } 39 42 parseElement(i); 40 43 } catch (Lexer::exception &e) { … … 46 49 // Only initialise scanners once 47 50 if (!initialised) { 51 // <?xml version="1.0" encoding="UTF-8" standalone="no"?> 52 xmlScan.addPattern(XmlDecl, "<\\?xml.*?>[[:space:]]*"); 48 53 xmlScan.addPattern(XmlCommentBegin, "<!--"); 49 54 xmlScan.addPattern(XmlBegin, "<[a-zA-Z0-9_-]+" todo/trunk/util/XML.h
r290 r443 65 65 66 66 // Lexer constants 67 enum { Xml CommentBegin = 256, XmlBegin, XmlEnd, XmlDataBegin, XmlContent };67 enum { XmlDecl = 256, XmlCommentBegin, XmlBegin, XmlEnd, XmlDataBegin, XmlContent }; 68 68 enum { ElementWS = 256, ElementValue, ElementKey, ElementAssignment, ElementTerminator}; 69 69 enum { CommentEnd = 256, CommentBody };
