summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/debuggerprotocol.h
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2015-12-11 13:28:21 +0100
committerhjk <hjk@theqtcompany.com>2015-12-21 07:32:14 +0000
commitc2bf384ac28feee10656c1ad41303159c5d06f34 (patch)
tree6aa75a135a599b57b5379f5ccea0b4965173e9a6 /src/plugins/debugger/debuggerprotocol.h
parent74b33929d847d98c7a9521912523156a4b8e6d14 (diff)
downloadqt-creator-c2bf384ac28feee10656c1ad41303159c5d06f34.tar.gz
Debugger: Split DebuggerEncoding enum
... into a string specifying a kind of encoding (utf8, latin1), an optional bytesize (2-byte integers, 4-byte integers) and a flag whether the displayed value should get "..." around it. Scales better than adding an enum value for each new combination. Change-Id: Iffcb1e2f148f12da96e165559a976bd34026c649 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Diffstat (limited to 'src/plugins/debugger/debuggerprotocol.h')
-rw-r--r--src/plugins/debugger/debuggerprotocol.h79
1 files changed, 27 insertions, 52 deletions
diff --git a/src/plugins/debugger/debuggerprotocol.h b/src/plugins/debugger/debuggerprotocol.h
index d7849a5b92..0ca23aff64 100644
--- a/src/plugins/debugger/debuggerprotocol.h
+++ b/src/plugins/debugger/debuggerprotocol.h
@@ -158,62 +158,37 @@ void extractGdbVersion(const QString &msg,
int *gdbVersion, int *gdbBuildVersion, bool *isMacGdb, bool *isQnxGdb);
-// These enum values correspond to encodings produced by the dumpers
-// and consumed by \c decodeData(const QByteArray &baIn, DebuggerEncoding encoding);
-// They are never stored in settings.
-//
-// Keep in sync with dumper.py
-
-enum DebuggerEncoding
+class DebuggerEncoding
{
- Unencoded8Bit = 0,
- Base64Encoded8BitWithQuotes = 1,
- Base64Encoded16BitWithQuotes = 2,
- Base64Encoded32BitWithQuotes = 3,
- Base64Encoded16Bit = 4,
- Base64Encoded8Bit = 5,
- Hex2EncodedLatin1WithQuotes = 6,
- Hex4EncodedLittleEndianWithQuotes = 7,
- Hex8EncodedLittleEndianWithQuotes = 8,
- Hex2EncodedUtf8WithQuotes = 9,
- Hex8EncodedBigEndian = 10,
- Hex4EncodedBigEndianWithQuotes = 11,
- Hex4EncodedLittleEndianWithoutQuotes = 12,
- Hex2EncodedLocal8BitWithQuotes = 13,
- JulianDate = 14,
- MillisecondsSinceMidnight = 15,
- JulianDateAndMillisecondsSinceMidnight = 16,
- Hex2EncodedInt1 = 17,
- Hex2EncodedInt2 = 18,
- Hex2EncodedInt4 = 19,
- Hex2EncodedInt8 = 20,
- Hex2EncodedUInt1 = 21,
- Hex2EncodedUInt2 = 22,
- Hex2EncodedUInt4 = 23,
- Hex2EncodedUInt8 = 24,
- Hex2EncodedFloat4 = 25,
- Hex2EncodedFloat8 = 26,
- IPv6AddressAndHexScopeId = 27,
- Hex2EncodedUtf8WithoutQuotes = 28,
- DateTimeInternal = 29,
- SpecialEmptyValue = 30,
- SpecialUninitializedValue = 31,
- SpecialInvalidValue = 32,
- SpecialNotAccessibleValue = 33,
- SpecialItemCountValue = 34,
- SpecialMinimumItemCountValue = 35,
- SpecialNotCallableValue = 36,
- SpecialNullReferenceValue = 37,
- SpecialOptimizedOutValue = 38,
- SpecialEmptyStructureValue = 39,
- SpecialUndefinedValue = 40,
- SpecialNullValue = 41
+public:
+ enum EncodingType {
+ Unencoded,
+ HexEncodedLocal8Bit,
+ HexEncodedLatin1,
+ HexEncodedUtf8,
+ HexEncodedUtf16,
+ HexEncodedUcs4,
+ HexEncodedSignedInteger,
+ HexEncodedUnsignedInteger,
+ HexEncodedFloat,
+ JulianDate,
+ MillisecondsSinceMidnight,
+ JulianDateAndMillisecondsSinceMidnight,
+ IPv6AddressAndHexScopeId,
+ DateTimeInternal,
+ };
+
+ DebuggerEncoding() {}
+ explicit DebuggerEncoding(const QByteArray &data);
+ QString toString() const;
+
+ EncodingType type = Unencoded;
+ int size = 0;
+ bool quotes = false;
};
-DebuggerEncoding debuggerEncoding(const QByteArray &data);
-
// Decode string data as returned by the dumper helpers.
-QString decodeData(const QByteArray &baIn, DebuggerEncoding encoding);
+QString decodeData(const QByteArray &baIn, const QByteArray &encoding);
// These enum values correspond to possible value display format requests,