From 38620a5d4d67566651271b516f01041bcf38b071 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 21 Jul 2009 08:29:51 +0000 Subject: Replacing SString with std::string. --- src/LexMPT.cxx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/LexMPT.cxx') diff --git a/src/LexMPT.cxx b/src/LexMPT.cxx index 93b8caba7..b0099ff86 100644 --- a/src/LexMPT.cxx +++ b/src/LexMPT.cxx @@ -11,6 +11,9 @@ #include #include #include + +#include + #include "Platform.h" #include "PropSet.h" @@ -18,13 +21,12 @@ #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" -#include "SString.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif -static int GetLotLineState(SString &line) { +static int GetLotLineState(std::string &line) { if (line.length()) { // Most of the time the first non-blank character in line determines that line's type // Now finds the first non-blank character @@ -54,13 +56,13 @@ static int GetLotLineState(SString &line) { default: // Any other line // Checks for message at the end of lot file - if (line.contains("PASSED")) { + if (line.find("PASSED") != std::string::npos) { return SCE_LOT_PASS; } - else if (line.contains("FAILED")) { + else if (line.find("FAILED") != std::string::npos) { return SCE_LOT_FAIL; } - else if (line.contains("ABORTED")) { + else if (line.find("ABORTED") != std::string::npos) { return SCE_LOT_ABORT; } else { @@ -78,8 +80,8 @@ static void ColourizeLotDoc(unsigned int startPos, int length, int, WordList *[] styler.StartSegment(startPos); bool atLineStart = true;// Arms the 'at line start' flag char chNext = styler.SafeGetCharAt(startPos); - SString line(""); - line.setsizegrowth(256); // Lot lines are less than 256 chars long most of the time. This should avoid reallocations + std::string line(""); + line.reserve(256); // Lot lines are less than 256 chars long most of the time. This should avoid reallocations // Styles LOT document unsigned int i; // Declared here because it's used after the for loop -- cgit v1.2.3