Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
982347dd
Commit
982347dd
authored
Oct 12, 2009
by
hjk
Browse files
debugger: provide support for .toHex() encoded string data.
more verbose than base64 but also less work on the dumper side
parent
f7263f23
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/watchutils.cpp
View file @
982347dd
...
...
@@ -409,7 +409,8 @@ QString decodeData(const QByteArray &ba, int encoding)
const
QChar
doubleQuote
(
QLatin1Char
(
'"'
));
const
QByteArray
decodedBa
=
QByteArray
::
fromBase64
(
ba
);
QString
rc
=
doubleQuote
;
rc
+=
QString
::
fromUtf16
(
reinterpret_cast
<
const
ushort
*>
(
decodedBa
.
data
()),
decodedBa
.
size
()
/
2
);
rc
+=
QString
::
fromUtf16
(
reinterpret_cast
<
const
ushort
*>
(
decodedBa
.
data
()),
decodedBa
.
size
()
/
2
);
rc
+=
doubleQuote
;
return
rc
;
}
...
...
@@ -417,17 +418,25 @@ QString decodeData(const QByteArray &ba, int encoding)
const
QByteArray
decodedBa
=
QByteArray
::
fromBase64
(
ba
);
const
QChar
doubleQuote
(
QLatin1Char
(
'"'
));
QString
rc
=
doubleQuote
;
rc
+=
QString
::
fromUcs4
(
reinterpret_cast
<
const
uint
*>
(
decodedBa
.
data
()),
decodedBa
.
size
()
/
4
);
rc
+=
QString
::
fromUcs4
(
reinterpret_cast
<
const
uint
*>
(
decodedBa
.
data
()),
decodedBa
.
size
()
/
4
);
rc
+=
doubleQuote
;
return
rc
;
}
case
4
:
{
// base64 encoded 16 bit data, without quotes (see 2)
const
QByteArray
decodedBa
=
QByteArray
::
fromBase64
(
ba
);
return
QString
::
fromUtf16
(
reinterpret_cast
<
const
ushort
*>
(
decodedBa
.
data
()),
decodedBa
.
size
()
/
2
);
return
QString
::
fromUtf16
(
reinterpret_cast
<
const
ushort
*>
(
decodedBa
.
data
()),
decodedBa
.
size
()
/
2
);
}
case
5
:
{
// base64 encoded 8 bit data, without quotes (see 1)
return
quoteUnprintableLatin1
(
QByteArray
::
fromBase64
(
ba
));
}
case
7
:
{
// %04x endoded 16 bit data
const
QByteArray
decodedBa
=
QByteArray
::
fromHex
(
ba
);
qDebug
()
<<
quoteUnprintableLatin1
(
decodedBa
)
<<
"
\n\n
"
;
return
QString
::
fromUtf16
(
reinterpret_cast
<
const
ushort
*>
(
decodedBa
.
data
()),
decodedBa
.
size
()
/
2
);
}
}
return
QCoreApplication
::
translate
(
"Debugger"
,
"<Encoding error>"
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment