Index: lldb/trunk/tools/lldb-mi/MICmdArgContext.cpp =================================================================== --- lldb/trunk/tools/lldb-mi/MICmdArgContext.cpp +++ lldb/trunk/tools/lldb-mi/MICmdArgContext.cpp @@ -85,16 +85,16 @@ if (vArg.empty()) return MIstatus::success; - const MIuint nLen = vArg.length(); - const MIuint nLenCntxt = m_strCmdArgsAndOptions.length(); + const size_t nLen = vArg.length(); + const size_t nLenCntxt = m_strCmdArgsAndOptions.length(); if (nLen > nLenCntxt) return MIstatus::failure; - MIuint nExtraSpace = 0; - MIint nPos = m_strCmdArgsAndOptions.find(vArg); + size_t nExtraSpace = 0; + size_t nPos = m_strCmdArgsAndOptions.find(vArg); while (1) { - if (nPos == (MIint)std::string::npos) + if (nPos == std::string::npos) return MIstatus::success; bool bPass1 = false; @@ -106,7 +106,7 @@ else bPass1 = true; - const MIuint nEnd = nPos + nLen; + const size_t nEnd = nPos + nLen; if (bPass1) { @@ -129,7 +129,7 @@ nPos = m_strCmdArgsAndOptions.find(vArg, nEnd); } - const MIuint nPosEnd = nLen + nExtraSpace; + const size_t nPosEnd = nLen + nExtraSpace; m_strCmdArgsAndOptions = m_strCmdArgsAndOptions.replace(nPos, nPosEnd, "").c_str(); m_strCmdArgsAndOptions = m_strCmdArgsAndOptions.Trim(); Index: lldb/trunk/tools/lldb-mi/MICmdArgValFile.cpp =================================================================== --- lldb/trunk/tools/lldb-mi/MICmdArgValFile.cpp +++ lldb/trunk/tools/lldb-mi/MICmdArgValFile.cpp @@ -122,8 +122,8 @@ // Look for a space in the path const char cSpace = ' '; - const MIint nPos = fileNamePath.find(cSpace); - if (nPos != (MIint)std::string::npos) + const size_t nPos = fileNamePath.find(cSpace); + if (nPos != std::string::npos) fileNamePath = CMIUtilString::Format("\"%s\"", fileNamePath.c_str()); return fileNamePath; @@ -146,7 +146,7 @@ const bool bHaveBckSlash = (vrFileNamePath.find_first_of("\\") != std::string::npos); // Look for --someLongOption - MIint nPos = vrFileNamePath.find_first_of("--"); + size_t nPos = vrFileNamePath.find_first_of("--"); const bool bLong = (nPos == 0); if (bLong) return false; Index: lldb/trunk/tools/lldb-mi/MICmdArgValOptionLong.cpp =================================================================== --- lldb/trunk/tools/lldb-mi/MICmdArgValOptionLong.cpp +++ lldb/trunk/tools/lldb-mi/MICmdArgValOptionLong.cpp @@ -254,7 +254,7 @@ if (bHavePosSlash || bHaveBckSlash) return false; - const MIint nPos = vrTxt.find_first_of("--"); + const size_t nPos = vrTxt.find_first_of("--"); if (nPos != 0) return false; Index: lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp =================================================================== --- lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp +++ lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp @@ -263,12 +263,12 @@ // CODETAG_QUOTEDTEXT_SIMILAR_CODE const char cQuote = '"'; - const MIint nPos = vrTxt.find(cQuote); - if (nPos == (MIint)std::string::npos) + const size_t nPos = vrTxt.find(cQuote); + if (nPos == std::string::npos) return false; // Is one and only quote at end of the string - if (nPos == (MIint)(vrTxt.length() - 1)) + if (nPos == (vrTxt.length() - 1)) return false; // Quote must be the first character in the string or be preceded by a space @@ -283,8 +283,8 @@ return false; // Need to find the other quote - const MIint nPos2 = vrTxt.rfind(cQuote); - if (nPos2 == (MIint)std::string::npos) + const size_t nPos2 = vrTxt.rfind(cQuote); + if (nPos2 == std::string::npos) return false; // Make sure not same quote, need two quotes @@ -309,8 +309,8 @@ { // CODETAG_QUOTEDTEXT_SIMILAR_CODE const char cBckSlash = '\\'; - const MIint nPos = vrTxt.find(cBckSlash); - if (nPos == (MIint)std::string::npos) + const size_t nPos = vrTxt.find(cBckSlash); + if (nPos == std::string::npos) return false; // Slash must be the first character in the string or be preceded by a space @@ -319,8 +319,8 @@ return false; // Need to find the other matching slash - const MIint nPos2 = vrTxt.rfind(cBckSlash); - if (nPos2 == (MIint)std::string::npos) + const size_t nPos2 = vrTxt.rfind(cBckSlash); + if (nPos2 == std::string::npos) return false; // Make sure not same back slash, need two slashes @@ -343,15 +343,15 @@ bool CMICmdArgValString::IsStringArgQuotedQuotedTextEmbedded(const CMIUtilString &vrTxt) const { - const MIint nPos = vrTxt.find("\"\\\""); - if (nPos == (MIint)std::string::npos) + const size_t nPos = vrTxt.find("\"\\\""); + if (nPos == std::string::npos) return false; - const MIint nPos2 = vrTxt.rfind("\\\"\""); - if (nPos2 == (MIint)std::string::npos) + const size_t nPos2 = vrTxt.rfind("\\\"\""); + if (nPos2 == std::string::npos) return false; - const MIint nLen = vrTxt.length(); + const size_t nLen = vrTxt.length(); if ((nLen > 5) && ((nPos + 2) == (nPos2 - 2))) return false; Index: lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp =================================================================== --- lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp +++ lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp @@ -1681,8 +1681,8 @@ } else { - const MIuint nLineStartPos = strLocation.rfind(':'); - if ((nLineStartPos == (MIuint)std::string::npos) || (nLineStartPos == 0) || (nLineStartPos == strLocation.length() - 1)) + const size_t nLineStartPos = strLocation.rfind(':'); + if ((nLineStartPos == std::string::npos) || (nLineStartPos == 0) || (nLineStartPos == strLocation.length() - 1)) { SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_LOCATION_FORMAT), m_cmdData.strMiCmd.c_str(), strLocation.c_str()) .c_str()); @@ -1739,9 +1739,9 @@ // LineEntry: \[0x0000000100000f37-0x0000000100000f45\): /path/to/file:3[:1] // ^^^^^^^^^ -- property - const MIuint nPropertyStartPos = rLine.find_first_not_of(' '); - const MIuint nPropertyEndPos = rLine.find(':'); - const MIuint nPropertyLen = nPropertyEndPos - nPropertyStartPos; + const size_t nPropertyStartPos = rLine.find_first_not_of(' '); + const size_t nPropertyEndPos = rLine.find(':'); + const size_t nPropertyLen = nPropertyEndPos - nPropertyStartPos; const CMIUtilString strProperty(rLine.substr(nPropertyStartPos, nPropertyLen).c_str()); // Skip all except LineEntry @@ -1750,9 +1750,9 @@ // LineEntry: \[0x0000000100000f37-0x0000000100000f45\): /path/to/file:3[:1] // ^^^^^^^^^^^^^^^^^^ -- start address - const MIuint nStartAddressStartPos = rLine.find("["); - const MIuint nStartAddressEndPos = rLine.find("-"); - const MIuint nStartAddressLen = nStartAddressEndPos - nStartAddressStartPos - 1; + const size_t nStartAddressStartPos = rLine.find("["); + const size_t nStartAddressEndPos = rLine.find("-"); + const size_t nStartAddressLen = nStartAddressEndPos - nStartAddressStartPos - 1; const CMIUtilString strStartAddress(rLine.substr(nStartAddressStartPos + 1, nStartAddressLen).c_str()); const CMICmnMIValueConst miValueConst(strStartAddress); const CMICmnMIValueResult miValueResult("start", miValueConst); @@ -1760,8 +1760,8 @@ // LineEntry: \[0x0000000100000f37-0x0000000100000f45\): /path/to/file:3[:1] // ^^^^^^^^^^^^^^^^^^ -- end address - const MIuint nEndAddressEndPos = rLine.find(")"); - const MIuint nEndAddressLen = nEndAddressEndPos - nStartAddressEndPos - 1; + const size_t nEndAddressEndPos = rLine.find(")"); + const size_t nEndAddressLen = nEndAddressEndPos - nStartAddressEndPos - 1; const CMIUtilString strEndAddress(rLine.substr(nStartAddressEndPos + 1, nEndAddressLen).c_str()); const CMICmnMIValueConst miValueConst2(strEndAddress); const CMICmnMIValueResult miValueResult2("end", miValueConst2); @@ -1773,11 +1773,11 @@ // ^^^^^^^^^^^^^ -- file // ^ -- line // ^ -- column (optional) - const MIuint nFileStartPos = rLine.find_first_not_of(' ', nEndAddressEndPos + 2); - const MIuint nFileOrLineEndPos = rLine.rfind(':'); - const MIuint nFileOrLineStartPos = rLine.rfind(':', nFileOrLineEndPos - 1); - const MIuint nFileEndPos = nFileStartPos < nFileOrLineStartPos ? nFileOrLineStartPos : nFileOrLineEndPos; - const MIuint nFileLen = nFileEndPos - nFileStartPos; + const size_t nFileStartPos = rLine.find_first_not_of(' ', nEndAddressEndPos + 2); + const size_t nFileOrLineEndPos = rLine.rfind(':'); + const size_t nFileOrLineStartPos = rLine.rfind(':', nFileOrLineEndPos - 1); + const size_t nFileEndPos = nFileStartPos < nFileOrLineStartPos ? nFileOrLineStartPos : nFileOrLineEndPos; + const size_t nFileLen = nFileEndPos - nFileStartPos; const CMIUtilString strFile(rLine.substr(nFileStartPos, nFileLen).c_str()); const CMICmnMIValueConst miValueConst3(strFile); const CMICmnMIValueResult miValueResult3("file", miValueConst3); @@ -1787,10 +1787,10 @@ // LineEntry: \[0x0000000100000f37-0x0000000100000f45\): /path/to/file:3[:1] // ^ -- line - const MIuint nLineStartPos = nFileEndPos + 1; - const MIuint nLineEndPos = rLine.find(':', nLineStartPos); - const MIuint nLineLen = nLineEndPos != (MIuint)std::string::npos ? nLineEndPos - nLineStartPos - 1 - : (MIuint)std::string::npos; + const size_t nLineStartPos = nFileEndPos + 1; + const size_t nLineEndPos = rLine.find(':', nLineStartPos); + const size_t nLineLen = nLineEndPos != std::string::npos ? nLineEndPos - nLineStartPos - 1 + : std::string::npos; const CMIUtilString strLine(rLine.substr(nLineStartPos, nLineLen).c_str()); const CMICmnMIValueConst miValueConst4(strLine); const CMICmnMIValueResult miValueResult4("line", miValueConst4); Index: lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp =================================================================== --- lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp +++ lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp @@ -126,7 +126,7 @@ // 0x0000000100000e70: /path/to/file:3[:4] // ^^^^^^^^^^^^^^^^^^ -- pc - const MIuint nAddrEndPos = rLine.find(':'); + const size_t nAddrEndPos = rLine.find(':'); const CMIUtilString strAddr(rLine.substr(0, nAddrEndPos).c_str()); const CMICmnMIValueConst miValueConst(strAddr); const CMICmnMIValueResult miValueResult("pc", miValueConst); @@ -134,10 +134,10 @@ // 0x0000000100000e70: /path/to/file:3[:4] // ^ -- line - const MIuint nLineOrColumnStartPos = rLine.rfind(':'); + const size_t nLineOrColumnStartPos = rLine.rfind(':'); const CMIUtilString strLineOrColumn(rLine.substr(nLineOrColumnStartPos + 1).c_str()); - const MIuint nPathOrLineStartPos = rLine.rfind(':', nLineOrColumnStartPos - 1); - const MIuint nPathOrLineLen = nLineOrColumnStartPos - nPathOrLineStartPos - 1; + const size_t nPathOrLineStartPos = rLine.rfind(':', nLineOrColumnStartPos - 1); + const size_t nPathOrLineLen = nLineOrColumnStartPos - nPathOrLineStartPos - 1; const CMIUtilString strPathOrLine(rLine.substr(nPathOrLineStartPos + 1, nPathOrLineLen).c_str()); const CMIUtilString strLine(strPathOrLine.IsNumber() ? strPathOrLine : strLineOrColumn); const CMICmnMIValueConst miValueConst2(strLine); Index: lldb/trunk/tools/lldb-mi/MICmdFactory.cpp =================================================================== --- lldb/trunk/tools/lldb-mi/MICmdFactory.cpp +++ lldb/trunk/tools/lldb-mi/MICmdFactory.cpp @@ -159,8 +159,8 @@ return false; } - const MIint nPos = vMiCmd.find(" "); - if (nPos != (MIint)std::string::npos) + const size_t nPos = vMiCmd.find(" "); + if (nPos != std::string::npos) bValid = false; return bValid; Index: lldb/trunk/tools/lldb-mi/MICmdInterpreter.cpp =================================================================== --- lldb/trunk/tools/lldb-mi/MICmdInterpreter.cpp +++ lldb/trunk/tools/lldb-mi/MICmdInterpreter.cpp @@ -153,8 +153,8 @@ CMICmdInterpreter::MiHasCmdTokenEndingHyphen(const CMIUtilString &vTextLine) { // The hyphen is mandatory - const MIint nPos = vTextLine.find("-", 0); - if ((nPos == (MIint)std::string::npos)) + const size_t nPos = vTextLine.find("-", 0); + if ((nPos == std::string::npos)) return false; if (MiHasCmdTokenPresent(vTextLine)) @@ -215,7 +215,7 @@ bool CMICmdInterpreter::MiHasCmdTokenPresent(const CMIUtilString &vTextLine) { - const MIint nPos = vTextLine.find("-", 0); + const size_t nPos = vTextLine.find("-", 0); return (nPos > 0); } @@ -233,11 +233,11 @@ bool CMICmdInterpreter::MiHasCmd(const CMIUtilString &vTextLine) { - MIint nPos = 0; + size_t nPos = 0; if (m_miCmdData.bMIOldStyle) { char cChar = vTextLine[0]; - MIuint i = 0; + size_t i = 0; while (::isdigit(cChar) != 0) { cChar = vTextLine[++i]; @@ -250,9 +250,9 @@ } bool bFoundCmd = false; - const MIint nLen = vTextLine.length(); - const MIint nPos2 = vTextLine.find(" ", nPos); - if (nPos2 != (MIint)std::string::npos) + const size_t nLen = vTextLine.length(); + const size_t nPos2 = vTextLine.find(" ", nPos); + if (nPos2 != std::string::npos) { if (nPos2 == nLen) return false; Index: lldb/trunk/tools/lldb-mi/MICmnLogMediumFile.cpp =================================================================== --- lldb/trunk/tools/lldb-mi/MICmnLogMediumFile.cpp +++ lldb/trunk/tools/lldb-mi/MICmnLogMediumFile.cpp @@ -283,8 +283,8 @@ data = ConvertCr(data); // Look for EOL... - const MIint pos = vData.rfind(strCr); - if (pos == (MIint)vData.size()) + const size_t pos = vData.rfind(strCr); + if (pos == vData.size()) return data; // ... did not have an EOL so add one @@ -382,11 +382,11 @@ if (strCr == rCrCmpat) return vData; - const MIuint nSizeCmpat(rCrCmpat.size()); - const MIuint nSize(strCr.size()); + const size_t nSizeCmpat(rCrCmpat.size()); + const size_t nSize(strCr.size()); CMIUtilString strConv(vData); - MIint pos = strConv.find(strCr); - while (pos != (MIint)CMIUtilString::npos) + size_t pos = strConv.find(strCr); + while (pos != CMIUtilString::npos) { strConv.replace(pos, nSize, rCrCmpat); pos = strConv.find(strCr, pos + nSizeCmpat); Index: lldb/trunk/tools/lldb-mi/MIDriver.cpp =================================================================== --- lldb/trunk/tools/lldb-mi/MIDriver.cpp +++ lldb/trunk/tools/lldb-mi/MIDriver.cpp @@ -862,7 +862,7 @@ // Also possible case when command not found: // 001 // ^ -- i.e. only tokens are present (or empty string at all) - const MIuint nCommandOffset = vTextLine.find_first_not_of(digits); + const size_t nCommandOffset = vTextLine.find_first_not_of(digits); // 2. Check if command is empty // For example: @@ -872,7 +872,7 @@ // or: // 001 // ^ -- command wasn't found - const bool bIsEmptyCommand = (nCommandOffset == (MIuint)CMIUtilString::npos); + const bool bIsEmptyCommand = (nCommandOffset == CMIUtilString::npos); // 3. Check and exit if it isn't a CLI command // For example: Index: lldb/trunk/tools/lldb-mi/MIDriverMgr.cpp =================================================================== --- lldb/trunk/tools/lldb-mi/MIDriverMgr.cpp +++ lldb/trunk/tools/lldb-mi/MIDriverMgr.cpp @@ -518,7 +518,7 @@ } if (0 == strArg.compare(0,10,"--log-dir=")) { - strLogDir = strArg.substr(10,CMIUtilString::npos); + strLogDir = strArg.substr(10, CMIUtilString::npos); bHaveArgLogDir = true; } if ((0 == strArg.compare("--help")) || (0 == strArg.compare("-h"))) Index: lldb/trunk/tools/lldb-mi/MIUtilFileStd.cpp =================================================================== --- lldb/trunk/tools/lldb-mi/MIUtilFileStd.cpp +++ lldb/trunk/tools/lldb-mi/MIUtilFileStd.cpp @@ -256,9 +256,9 @@ CMIUtilString CMIUtilFileStd::StripOffFileName(const CMIUtilString &vDirectoryPath) { - const MIint nPos = vDirectoryPath.rfind('\\'); - MIint nPos2 = vDirectoryPath.rfind('/'); - if ((nPos == (MIint)std::string::npos) && (nPos2 == (MIint)std::string::npos)) + const size_t nPos = vDirectoryPath.rfind('\\'); + size_t nPos2 = vDirectoryPath.rfind('/'); + if ((nPos == std::string::npos) && (nPos2 == std::string::npos)) return vDirectoryPath; if (nPos > nPos2) Index: lldb/trunk/tools/lldb-mi/MIUtilString.h =================================================================== --- lldb/trunk/tools/lldb-mi/MIUtilString.h +++ lldb/trunk/tools/lldb-mi/MIUtilString.h @@ -53,18 +53,18 @@ bool IsHexadecimalNumber(void) const; bool IsQuoted(void) const; CMIUtilString RemoveRepeatedCharacters(const char vChar); - MIuint Split(const CMIUtilString &vDelimiter, VecString_t &vwVecSplits) const; - MIuint SplitConsiderQuotes(const CMIUtilString &vDelimiter, VecString_t &vwVecSplits) const; - MIuint SplitLines(VecString_t &vwVecSplits) const; + size_t Split(const CMIUtilString &vDelimiter, VecString_t &vwVecSplits) const; + size_t SplitConsiderQuotes(const CMIUtilString &vDelimiter, VecString_t &vwVecSplits) const; + size_t SplitLines(VecString_t &vwVecSplits) const; CMIUtilString StripCREndOfLine(void) const; CMIUtilString StripCRAll(void) const; CMIUtilString Trim(void) const; CMIUtilString Trim(const char vChar) const; - MIuint FindFirst(const CMIUtilString &vrPattern, const MIuint vnPos = 0) const; - MIuint FindFirst(const CMIUtilString &vrPattern, const bool vbSkipQuotedText, bool &vrwbNotFoundClosedQuote, - const MIuint vnPos = 0) const; - MIuint FindFirstNot(const CMIUtilString &vrPattern, const MIuint vnPos = 0) const; - CMIUtilString Escape(const bool vbEscapeQuotes = false) const; + size_t FindFirst(const CMIUtilString &vrPattern, size_t vnPos = 0) const; + size_t FindFirst(const CMIUtilString &vrPattern, bool vbSkipQuotedText, bool &vrwbNotFoundClosedQuote, + size_t vnPos = 0) const; + size_t FindFirstNot(const CMIUtilString &vrPattern, size_t vnPos = 0) const; + CMIUtilString Escape(bool vbEscapeQuotes = false) const; CMIUtilString AddSlashes(void) const; CMIUtilString StripSlashes(void) const; // @@ -82,6 +82,6 @@ // Methods: private: bool ExtractNumberFromHexadecimal(MIint64 &vwrNumber) const; - CMIUtilString RemoveRepeatedCharacters(const MIint vnPos, const char vChar); - MIuint FindFirstQuote(const MIuint vnPos) const; + CMIUtilString RemoveRepeatedCharacters(size_t vnPos, const char vChar); + size_t FindFirstQuote(size_t vnPos) const; }; Index: lldb/trunk/tools/lldb-mi/MIUtilString.cpp =================================================================== --- lldb/trunk/tools/lldb-mi/MIUtilString.cpp +++ lldb/trunk/tools/lldb-mi/MIUtilString.cpp @@ -202,10 +202,10 @@ // Args: vData - (R) String data to be split up. // vDelimiter - (R) Delimiter char or text. // vwVecSplits - (W) Container of splits found in string data. -// Return: MIuint - Number of splits found in the string data. +// Return: size_t - Number of splits found in the string data. // Throws: None. //-- -MIuint +size_t CMIUtilString::Split(const CMIUtilString &vDelimiter, VecString_t &vwVecSplits) const { vwVecSplits.clear(); @@ -213,22 +213,22 @@ if (this->empty() || vDelimiter.empty()) return 0; - const MIuint nLen(length()); - MIuint nOffset(0); + const size_t nLen(length()); + size_t nOffset(0); do { // Find first occurrence which doesn't match to the delimiter - const MIuint nSectionPos(FindFirstNot(vDelimiter, nOffset)); - if (nSectionPos == (MIuint)std::string::npos) + const size_t nSectionPos(FindFirstNot(vDelimiter, nOffset)); + if (nSectionPos == std::string::npos) break; // Find next occurrence of the delimiter after section - MIuint nNextDelimiterPos(FindFirst(vDelimiter, nSectionPos)); - if (nNextDelimiterPos == (MIuint)std::string::npos) + size_t nNextDelimiterPos(FindFirst(vDelimiter, nSectionPos)); + if (nNextDelimiterPos == std::string::npos) nNextDelimiterPos = nLen; // Extract string between delimiters - const MIuint nSectionLen(nNextDelimiterPos - nSectionPos); + const size_t nSectionLen(nNextDelimiterPos - nSectionPos); const std::string strSection(substr(nSectionPos, nSectionLen)); vwVecSplits.push_back(strSection.c_str()); @@ -251,10 +251,10 @@ // Args: vData - (R) String data to be split up. // vDelimiter - (R) Delimiter char or text. // vwVecSplits - (W) Container of splits found in string data. -// Return: MIuint - Number of splits found in the string data. +// Return: size_t - Number of splits found in the string data. // Throws: None. //-- -MIuint +size_t CMIUtilString::SplitConsiderQuotes(const CMIUtilString &vDelimiter, VecString_t &vwVecSplits) const { vwVecSplits.clear(); @@ -262,29 +262,29 @@ if (this->empty() || vDelimiter.empty()) return 0; - const MIuint nLen(length()); - MIuint nOffset(0); + const size_t nLen(length()); + size_t nOffset(0); do { // Find first occurrence which doesn't match to the delimiter - const MIuint nSectionPos(FindFirstNot(vDelimiter, nOffset)); - if (nSectionPos == (MIuint)std::string::npos) + const size_t nSectionPos(FindFirstNot(vDelimiter, nOffset)); + if (nSectionPos == std::string::npos) break; // Find next occurrence of the delimiter after (quoted) section const bool bSkipQuotedText(true); bool bUnmatchedQuote(false); - MIuint nNextDelimiterPos(FindFirst(vDelimiter, bSkipQuotedText, bUnmatchedQuote, nSectionPos)); + size_t nNextDelimiterPos(FindFirst(vDelimiter, bSkipQuotedText, bUnmatchedQuote, nSectionPos)); if (bUnmatchedQuote) { vwVecSplits.clear(); return 0; } - if (nNextDelimiterPos == (MIuint)std::string::npos) + if (nNextDelimiterPos == std::string::npos) nNextDelimiterPos = nLen; // Extract string between delimiters - const MIuint nSectionLen(nNextDelimiterPos - nSectionPos); + const size_t nSectionLen(nNextDelimiterPos - nSectionPos); const std::string strSection(substr(nSectionPos, nSectionLen)); vwVecSplits.push_back(strSection.c_str()); @@ -300,10 +300,10 @@ // Details: Split string into lines using \n and return an array of strings. // Type: Method. // Args: vwVecSplits - (W) Container of splits found in string data. -// Return: MIuint - Number of splits found in the string data. +// Return: size_t - Number of splits found in the string data. // Throws: None. //-- -MIuint +size_t CMIUtilString::SplitLines(VecString_t &vwVecSplits) const { return Split("\n", vwVecSplits); @@ -320,8 +320,8 @@ CMIUtilString CMIUtilString::StripCREndOfLine(void) const { - const MIint nPos = rfind('\n'); - if (nPos == (MIint)std::string::npos) + const size_t nPos = rfind('\n'); + if (nPos == std::string::npos) return *this; const CMIUtilString strNew(substr(0, nPos).c_str()); @@ -358,12 +358,12 @@ if (vFind.empty() || this->empty()) return *this; - MIint nPos = find(vFind); - if (nPos == (MIint)std::string::npos) + size_t nPos = find(vFind); + if (nPos == std::string::npos) return *this; CMIUtilString strNew(*this); - while (nPos != (MIint)std::string::npos) + while (nPos != std::string::npos) { strNew.replace(nPos, vFind.length(), vReplaceWith); nPos += vReplaceWith.length(); @@ -389,8 +389,8 @@ if ((at(0) == '-') && (length() == 1)) return false; - const MIint nPos = find_first_not_of("-.0123456789"); - if (nPos != (MIint)std::string::npos) + const size_t nPos = find_first_not_of("-.0123456789"); + if (nPos != std::string::npos) return false; return true; @@ -411,8 +411,8 @@ return false; // Skip '0x..' prefix - const MIint nPos = find_first_not_of("01234567890ABCDEFabcedf", 2); - if (nPos != (MIint)std::string::npos) + const size_t nPos = find_first_not_of("01234567890ABCDEFabcedf", 2); + if (nPos != std::string::npos) return false; return true; @@ -457,8 +457,8 @@ { vwrNumber = 0; - const MIint nPos = find_first_not_of("xX01234567890ABCDEFabcedf"); - if (nPos != (MIint)std::string::npos) + const size_t nPos = find_first_not_of("xX01234567890ABCDEFabcedf"); + if (nPos != std::string::npos) return false; errno = 0; @@ -482,11 +482,11 @@ bool CMIUtilString::IsAllValidAlphaAndNumeric(const char *vpText) { - const MIuint len = ::strlen(vpText); + const size_t len = ::strlen(vpText); if (len == 0) return false; - for (MIuint i = 0; i < len; i++, vpText++) + for (size_t i = 0; i < len; i++, vpText++) { const char c = *vpText; if (::isalnum((int)c) == 0) @@ -526,13 +526,13 @@ { CMIUtilString strNew(*this); const char *pWhiteSpace = " \t\n\v\f\r"; - const MIint nPos = find_last_not_of(pWhiteSpace); - if (nPos != (MIint)std::string::npos) + const size_t nPos = find_last_not_of(pWhiteSpace); + if (nPos != std::string::npos) { strNew = substr(0, nPos + 1).c_str(); } - const MIint nPos2 = strNew.find_first_not_of(pWhiteSpace); - if (nPos2 != (MIint)std::string::npos) + const size_t nPos2 = strNew.find_first_not_of(pWhiteSpace); + if (nPos2 != std::string::npos) { strNew = strNew.substr(nPos2).c_str(); } @@ -551,7 +551,7 @@ CMIUtilString::Trim(const char vChar) const { CMIUtilString strNew(*this); - const MIint nLen = strNew.length(); + const size_t nLen = strNew.length(); if (nLen > 1) { if ((strNew[0] == vChar) && (strNew[nLen - 1] == vChar)) @@ -617,22 +617,22 @@ // character. // Type: Method. // Args: vChar - (R) The character to search for and remove adjacent duplicates. -// vnPos - (R) Character position in the string. +// vnPos - Character position in the string. // Return: CMIUtilString - New version of the string. // Throws: None. //-- CMIUtilString -CMIUtilString::RemoveRepeatedCharacters(const MIint vnPos, const char vChar) +CMIUtilString::RemoveRepeatedCharacters(size_t vnPos, const char vChar) { const char cQuote = '"'; // Look for first quote of two - MIint nPos = find(cQuote, vnPos); - if (nPos == (MIint)std::string::npos) + const size_t nPos = find(cQuote, vnPos); + if (nPos == std::string::npos) return *this; - const MIint nPosNext = nPos + 1; - if (nPosNext > (MIint)length()) + const size_t nPosNext = nPos + 1; + if (nPosNext > length()) return *this; if (at(nPosNext) == cQuote) @@ -659,7 +659,7 @@ if (at(0) != cQuote) return false; - const MIint nLen = length(); + const size_t nLen = length(); if ((nLen > 0) && (at(nLen - 1) != cQuote)) return false; @@ -670,12 +670,12 @@ // Details: Find first occurrence in *this string which matches the pattern. // Type: Method. // Args: vrPattern - (R) The pattern to search for. -// vnPos - (R) The starting position at which to start searching. (Dflt = 0) -// Return: MIuint - The position of the first substring that match. +// vnPos - The starting position at which to start searching. (Dflt = 0) +// Return: size_t - The position of the first substring that match. // Throws: None. //-- -MIuint -CMIUtilString::FindFirst(const CMIUtilString &vrPattern, const MIuint vnPos /* = 0 */) const +size_t +CMIUtilString::FindFirst(const CMIUtilString &vrPattern, size_t vnPos /* = 0 */) const { return find(vrPattern, vnPos); } @@ -686,61 +686,61 @@ // Args: vrPattern - (R) The pattern to search for. // vbSkipQuotedText - (R) True = don't look at quoted text, false = otherwise. // vrwbNotFoundClosedQuote - (W) True = parsing error: unmatched quote, false = otherwise. -// vnPos - (R) Position of the first character in the string to be considered in the search. (Dflt = 0) -// Return: MIuint - The position of the first substring that matches and isn't quoted. +// vnPos - Position of the first character in the string to be considered in the search. (Dflt = 0) +// Return: size_t - The position of the first substring that matches and isn't quoted. // Throws: None. //-- -MIuint +size_t CMIUtilString::FindFirst(const CMIUtilString &vrPattern, const bool vbSkipQuotedText, bool &vrwbNotFoundClosedQuote, - const MIuint vnPos /* = 0 */) const + size_t vnPos /* = 0 */) const { vrwbNotFoundClosedQuote = false; if (!vbSkipQuotedText) return FindFirst(vrPattern, vnPos); - const MIuint nLen(length()); + const size_t nLen(length()); - MIuint nPos = vnPos; + size_t nPos = vnPos; do { - const MIuint nQuotePos(FindFirstQuote(nPos)); - const MIuint nPatternPos(FindFirst(vrPattern, nPos)); - if (nQuotePos == (MIuint)std::string::npos) + const size_t nQuotePos(FindFirstQuote(nPos)); + const size_t nPatternPos(FindFirst(vrPattern, nPos)); + if (nQuotePos == std::string::npos) return nPatternPos; - const MIuint nQuoteClosedPos = FindFirstQuote(nQuotePos + 1); - if (nQuoteClosedPos == (MIuint)std::string::npos) + const size_t nQuoteClosedPos = FindFirstQuote(nQuotePos + 1); + if (nQuoteClosedPos == std::string::npos) { vrwbNotFoundClosedQuote = true; - return (MIuint)std::string::npos; + return std::string::npos; } - if ((nPatternPos == (MIuint)std::string::npos) || (nPatternPos < nQuotePos)) + if ((nPatternPos == std::string::npos) || (nPatternPos < nQuotePos)) return nPatternPos; nPos = nQuoteClosedPos + 1; } while (nPos < nLen); - return (MIuint)std::string::npos; + return std::string::npos; } //++ ------------------------------------------------------------------------------------ // Details: Find first occurrence in *this string which doesn't match the pattern. // Type: Method. // Args: vrPattern - (R) The pattern to search for. -// vnPos - (R) Position of the first character in the string to be considered in the search. (Dflt = 0) -// Return: MIuint - The position of the first character that doesn't match. +// vnPos - Position of the first character in the string to be considered in the search. (Dflt = 0) +// Return: size_t - The position of the first character that doesn't match. // Throws: None. //-- -MIuint -CMIUtilString::FindFirstNot(const CMIUtilString &vrPattern, const MIuint vnPos /* = 0 */) const +size_t +CMIUtilString::FindFirstNot(const CMIUtilString &vrPattern, size_t vnPos /* = 0 */) const { - const MIuint nLen(length()); - const MIuint nPatternLen(vrPattern.length()); + const size_t nLen(length()); + const size_t nPatternLen(vrPattern.length()); - MIuint nPatternPos(vnPos); + size_t nPatternPos(vnPos); do { const bool bMatchPattern(compare(nPatternPos, nPatternLen, vrPattern) == 0); @@ -750,29 +750,29 @@ } while (nPatternPos < nLen); - return (MIuint)std::string::npos; + return std::string::npos; } //++ ------------------------------------------------------------------------------------ // Details: Find first occurrence of not escaped quotation mark in *this string. // Type: Method. -// Args: vnPos - (R) Position of the first character in the string to be considered in the search. -// Return: MIuint - The position of the quotation mark. +// Args: vnPos - Position of the first character in the string to be considered in the search. +// Return: size_t - The position of the quotation mark. // Throws: None. //-- -MIuint -CMIUtilString::FindFirstQuote(const MIuint vnPos) const +size_t +CMIUtilString::FindFirstQuote(size_t vnPos) const { const char cBckSlash('\\'); const char cQuote('"'); - const MIuint nLen(length()); + const size_t nLen(length()); - MIuint nPos = vnPos; + size_t nPos = vnPos; do { - const MIuint nBckSlashPos(find(cBckSlash, nPos)); - const MIuint nQuotePos(find(cQuote, nPos)); - if ((nBckSlashPos == (MIuint)std::string::npos) || (nQuotePos == (MIuint)std::string::npos)) + const size_t nBckSlashPos(find(cBckSlash, nPos)); + const size_t nQuotePos(find(cQuote, nPos)); + if ((nBckSlashPos == std::string::npos) || (nQuotePos == std::string::npos)) return nQuotePos; if (nQuotePos < nBckSlashPos) @@ -783,7 +783,7 @@ } while (nPos < nLen); - return (MIuint)std::string::npos; + return std::string::npos; } //++ ------------------------------------------------------------------------------------ @@ -794,12 +794,12 @@ // Throws: None. //-- CMIUtilString -CMIUtilString::Escape(const bool vbEscapeQuotes /* = false */) const +CMIUtilString::Escape(bool vbEscapeQuotes /* = false */) const { - const MIuint nLen(length()); + const size_t nLen(length()); CMIUtilString strNew; strNew.reserve(nLen); - for (MIuint nIndex(0); nIndex < nLen; ++nIndex) + for (size_t nIndex(0); nIndex < nLen; ++nIndex) { const char cUnescapedChar((*this)[nIndex]); if (cUnescapedChar == '"' && vbEscapeQuotes) @@ -822,22 +822,22 @@ CMIUtilString::AddSlashes(void) const { const char cBckSlash('\\'); - const MIuint nLen(length()); + const size_t nLen(length()); CMIUtilString strNew; strNew.reserve(nLen); - MIuint nOffset(0); + size_t nOffset(0); while (nOffset < nLen) { - const MIuint nUnescapedCharPos(find_first_of("\"\\", nOffset)); - const bool bUnescapedCharNotFound(nUnescapedCharPos == (MIuint)std::string::npos); + const size_t nUnescapedCharPos(find_first_of("\"\\", nOffset)); + const bool bUnescapedCharNotFound(nUnescapedCharPos == std::string::npos); if (bUnescapedCharNotFound) { - const MIuint nAppendAll((MIuint)std::string::npos); + const size_t nAppendAll(std::string::npos); strNew.append(*this, nOffset, nAppendAll); break; } - const MIuint nAppendLen(nUnescapedCharPos - nOffset); + const size_t nAppendLen(nUnescapedCharPos - nOffset); strNew.append(*this, nOffset, nAppendLen); strNew.push_back(cBckSlash); const char cUnescapedChar((*this)[nUnescapedCharPos]); @@ -859,22 +859,22 @@ CMIUtilString::StripSlashes(void) const { const char cBckSlash('\\'); - const MIuint nLen(length()); + const size_t nLen(length()); CMIUtilString strNew; strNew.reserve(nLen); - MIuint nOffset(0); + size_t nOffset(0); while (nOffset < nLen) { - const MIuint nBckSlashPos(find(cBckSlash, nOffset)); - const bool bBckSlashNotFound(nBckSlashPos == (MIuint)std::string::npos); + const size_t nBckSlashPos(find(cBckSlash, nOffset)); + const bool bBckSlashNotFound(nBckSlashPos == std::string::npos); if (bBckSlashNotFound) { - const MIuint nAppendAll((MIuint)std::string::npos); + const size_t nAppendAll(std::string::npos); strNew.append(*this, nOffset, nAppendAll); break; } - const MIuint nAppendLen(nBckSlashPos - nOffset); + const size_t nAppendLen(nBckSlashPos - nOffset); strNew.append(*this, nOffset, nAppendLen); const bool bBckSlashIsLast(nBckSlashPos == nLen); if (bBckSlashIsLast) @@ -883,8 +883,8 @@ break; } const char cEscapedChar((*this)[nBckSlashPos + 1]); - const MIuint nEscapedCharPos(std::string("\"\\").find(cEscapedChar)); - const bool bEscapedCharNotFound(nEscapedCharPos == (MIuint)std::string::npos); + const size_t nEscapedCharPos(std::string("\"\\").find(cEscapedChar)); + const bool bEscapedCharNotFound(nEscapedCharPos == std::string::npos); if (bEscapedCharNotFound) strNew.push_back(cBckSlash); strNew.push_back(cEscapedChar);