forked from qt-creator/qt-creator
Debugger: Remove unused functions in cdb extension
Change-Id: I96991f8dad6f384d798bd27738176fe7319de797 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -68,33 +68,6 @@ void trimBack(std::string &s)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void simplify(std::string &s)
|
|
||||||
{
|
|
||||||
trimFront(s);
|
|
||||||
trimBack(s);
|
|
||||||
if (s.empty())
|
|
||||||
return;
|
|
||||||
|
|
||||||
// 1) All blanks
|
|
||||||
const std::string::size_type size1 = s.size();
|
|
||||||
std::string::size_type pos = 0;
|
|
||||||
for ( ; pos < size1; pos++)
|
|
||||||
if (std::isspace(s.at(pos)))
|
|
||||||
s[pos] = ' ';
|
|
||||||
// 2) Simplify
|
|
||||||
for (pos = 0; pos < s.size(); ) {
|
|
||||||
std::string::size_type blankpos = s.find(' ', pos);
|
|
||||||
if (blankpos == std::string::npos)
|
|
||||||
break;
|
|
||||||
std::string::size_type tokenpos = blankpos + 1;
|
|
||||||
while (tokenpos < s.size() && s.at(tokenpos) == ' ')
|
|
||||||
tokenpos++;
|
|
||||||
if (tokenpos - blankpos > 1)
|
|
||||||
s.erase(blankpos, tokenpos - blankpos - 1);
|
|
||||||
pos = blankpos + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void replace(std::wstring &s, wchar_t before, wchar_t after)
|
void replace(std::wstring &s, wchar_t before, wchar_t after)
|
||||||
{
|
{
|
||||||
const std::wstring::size_type size = s.size();
|
const std::wstring::size_type size = s.size();
|
||||||
@@ -168,13 +141,6 @@ void gdbmiWStringFormat::format(std::ostream &str) const
|
|||||||
formatGdbmiChar(str, m_w.at(i));
|
formatGdbmiChar(str, m_w.at(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string wStringToGdbmiString(const std::wstring &w)
|
|
||||||
{
|
|
||||||
std::ostringstream str;
|
|
||||||
str << gdbmiWStringFormat(w);
|
|
||||||
return str.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string wStringToString(const std::wstring &w)
|
std::string wStringToString(const std::wstring &w)
|
||||||
{
|
{
|
||||||
if (w.empty())
|
if (w.empty())
|
||||||
@@ -187,18 +153,6 @@ std::string wStringToString(const std::wstring &w)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::wstring stringToWString(const std::string &w)
|
|
||||||
{
|
|
||||||
if (w.empty())
|
|
||||||
return std::wstring();
|
|
||||||
const std::wstring::size_type size = w.size();
|
|
||||||
std::wstring rc;
|
|
||||||
rc.reserve(size);
|
|
||||||
for (std::wstring::size_type i = 0; i < size; ++i)
|
|
||||||
rc.push_back(w.at(i));
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert an ASCII hex digit to its value 'A'->10
|
// Convert an ASCII hex digit to its value 'A'->10
|
||||||
inline unsigned hexDigit(char c)
|
inline unsigned hexDigit(char c)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,7 +39,6 @@
|
|||||||
void trimFront(std::string &s); // Strip blanks off front
|
void trimFront(std::string &s); // Strip blanks off front
|
||||||
void trimBack(std::string &s); // Strip blanks off back
|
void trimBack(std::string &s); // Strip blanks off back
|
||||||
// Simplify blanks, that is " A \tB " -> "A B".
|
// Simplify blanks, that is " A \tB " -> "A B".
|
||||||
void simplify(std::string &s);
|
|
||||||
|
|
||||||
// Split a token sequence in a string by character separator.
|
// Split a token sequence in a string by character separator.
|
||||||
template <class Iterator>
|
template <class Iterator>
|
||||||
@@ -173,9 +172,7 @@ inline std::ostream &operator<<(std::ostream &str, const gdbmiWStringFormat &wsf
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string wStringToGdbmiString(const std::wstring &w);
|
|
||||||
std::string wStringToString(const std::wstring &w);
|
std::string wStringToString(const std::wstring &w);
|
||||||
std::wstring stringToWString(const std::string &w);
|
|
||||||
|
|
||||||
// Strings from raw data.
|
// Strings from raw data.
|
||||||
std::wstring quotedWStringFromCharData(const unsigned char *data, size_t size, bool truncated = false);
|
std::wstring quotedWStringFromCharData(const unsigned char *data, size_t size, bool truncated = false);
|
||||||
|
|||||||
Reference in New Issue
Block a user