aboutsummaryrefslogtreecommitdiff
path: root/lldb/tools/lldb-mi/MIUtilString.h
diff options
context:
space:
mode:
authorKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
committerKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
commitb9c1b51e45b845debb76d8658edabca70ca56079 (patch)
treedfcb5a13ef2b014202340f47036da383eaee74aa /lldb/tools/lldb-mi/MIUtilString.h
parentd5aa73376966339caad04013510626ec2e42c760 (diff)
downloadllvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip
llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz
llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.bz2
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
Diffstat (limited to 'lldb/tools/lldb-mi/MIUtilString.h')
-rw-r--r--lldb/tools/lldb-mi/MIUtilString.h125
1 files changed, 66 insertions, 59 deletions
diff --git a/lldb/tools/lldb-mi/MIUtilString.h b/lldb/tools/lldb-mi/MIUtilString.h
index 2326160..3b07772 100644
--- a/lldb/tools/lldb-mi/MIUtilString.h
+++ b/lldb/tools/lldb-mi/MIUtilString.h
@@ -10,77 +10,84 @@
#pragma once
// Third party headers:
-#include <string>
-#include <vector>
#include <cinttypes>
#include <cstdarg>
+#include <string>
+#include <vector>
// In-house headers:
#include "MIDataTypes.h"
-//++ ============================================================================
+//++
+//============================================================================
// Details: MI common code utility class. Used to help handle text.
// Derived from std::string
//--
-class CMIUtilString : public std::string
-{
- // Typedefs:
- public:
- typedef std::vector<CMIUtilString> VecString_t;
+class CMIUtilString : public std::string {
+ // Typedefs:
+public:
+ typedef std::vector<CMIUtilString> VecString_t;
- // Static method:
- public:
- static CMIUtilString Format(const CMIUtilString vFormating, ...);
- static CMIUtilString FormatBinary(const MIuint64 vnDecimal);
- static CMIUtilString FormatValist(const CMIUtilString &vrFormating, va_list vArgs);
- static bool IsAllValidAlphaAndNumeric(const char *vpText);
- static bool Compare(const CMIUtilString &vrLhs, const CMIUtilString &vrRhs);
- static CMIUtilString ConvertToPrintableASCII(const char vChar, bool bEscapeQuotes = false);
- static CMIUtilString ConvertToPrintableASCII(const char16_t vChar16, bool bEscapeQuotes = false);
- static CMIUtilString ConvertToPrintableASCII(const char32_t vChar32, bool bEscapeQuotes = false);
+ // Static method:
+public:
+ static CMIUtilString Format(const CMIUtilString vFormating, ...);
+ static CMIUtilString FormatBinary(const MIuint64 vnDecimal);
+ static CMIUtilString FormatValist(const CMIUtilString &vrFormating,
+ va_list vArgs);
+ static bool IsAllValidAlphaAndNumeric(const char *vpText);
+ static bool Compare(const CMIUtilString &vrLhs, const CMIUtilString &vrRhs);
+ static CMIUtilString ConvertToPrintableASCII(const char vChar,
+ bool bEscapeQuotes = false);
+ static CMIUtilString ConvertToPrintableASCII(const char16_t vChar16,
+ bool bEscapeQuotes = false);
+ static CMIUtilString ConvertToPrintableASCII(const char32_t vChar32,
+ bool bEscapeQuotes = false);
- // Methods:
- public:
- /* ctor */ CMIUtilString();
- /* ctor */ CMIUtilString(const char *vpData);
- /* ctor */ CMIUtilString(const std::string& vrStr);
- //
- bool ExtractNumber(MIint64 &vwrNumber) const;
- CMIUtilString FindAndReplace(const CMIUtilString &vFind, const CMIUtilString &vReplaceWith) const;
- bool IsNumber() const;
- bool IsHexadecimalNumber() const;
- bool IsQuoted() const;
- CMIUtilString RemoveRepeatedCharacters(const char vChar);
- 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() const;
- CMIUtilString StripCRAll() const;
- CMIUtilString Trim() const;
- CMIUtilString Trim(const char vChar) 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() const;
- CMIUtilString StripSlashes() const;
- //
- CMIUtilString &operator=(const char *vpRhs);
- CMIUtilString &operator=(const std::string &vrRhs);
+ // Methods:
+public:
+ /* ctor */ CMIUtilString();
+ /* ctor */ CMIUtilString(const char *vpData);
+ /* ctor */ CMIUtilString(const std::string &vrStr);
+ //
+ bool ExtractNumber(MIint64 &vwrNumber) const;
+ CMIUtilString FindAndReplace(const CMIUtilString &vFind,
+ const CMIUtilString &vReplaceWith) const;
+ bool IsNumber() const;
+ bool IsHexadecimalNumber() const;
+ bool IsQuoted() const;
+ CMIUtilString RemoveRepeatedCharacters(const char vChar);
+ 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() const;
+ CMIUtilString StripCRAll() const;
+ CMIUtilString Trim() const;
+ CMIUtilString Trim(const char vChar) 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() const;
+ CMIUtilString StripSlashes() const;
+ //
+ CMIUtilString &operator=(const char *vpRhs);
+ CMIUtilString &operator=(const std::string &vrRhs);
- // Overrideable:
- public:
- /* dtor */ virtual ~CMIUtilString();
+ // Overrideable:
+public:
+ /* dtor */ virtual ~CMIUtilString();
- // Static method:
- private:
- static CMIUtilString FormatPriv(const CMIUtilString &vrFormat, va_list vArgs);
- static CMIUtilString ConvertCharValueToPrintableASCII(char vChar, bool bEscapeQuotes);
+ // Static method:
+private:
+ static CMIUtilString FormatPriv(const CMIUtilString &vrFormat, va_list vArgs);
+ static CMIUtilString ConvertCharValueToPrintableASCII(char vChar,
+ bool bEscapeQuotes);
- // Methods:
- private:
- bool ExtractNumberFromHexadecimal(MIint64 &vwrNumber) const;
- CMIUtilString RemoveRepeatedCharacters(size_t vnPos, const char vChar);
- size_t FindFirstQuote(size_t vnPos) const;
+ // Methods:
+private:
+ bool ExtractNumberFromHexadecimal(MIint64 &vwrNumber) const;
+ CMIUtilString RemoveRepeatedCharacters(size_t vnPos, const char vChar);
+ size_t FindFirstQuote(size_t vnPos) const;
};