Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flatpak-qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marco Bubke
flatpak-qt-creator
Commits
2eed41b6
Commit
2eed41b6
authored
15 years ago
by
hjk
Browse files
Options
Downloads
Patches
Plain Diff
debugger: make stringFromByte local
parent
751f2f69
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/shared/trk/trkutils.cpp
+26
-26
26 additions, 26 deletions
src/shared/trk/trkutils.cpp
src/shared/trk/trkutils.h
+0
-2
0 additions, 2 deletions
src/shared/trk/trkutils.h
with
26 additions
and
28 deletions
src/shared/trk/trkutils.cpp
+
26
−
26
View file @
2eed41b6
...
...
@@ -36,6 +36,32 @@
namespace
trk
{
// FIXME: Use the QByteArray based version below?
QString
stringFromByte
(
byte
c
)
{
return
QString
(
"%1 "
).
arg
(
c
,
2
,
16
,
QChar
(
'0'
));
}
QString
stringFromArray
(
const
QByteArray
&
ba
,
int
maxLen
)
{
QString
str
;
QString
ascii
;
const
int
size
=
maxLen
==
-
1
?
ba
.
size
()
:
qMin
(
ba
.
size
(),
maxLen
);
for
(
int
i
=
0
;
i
<
size
;
++
i
)
{
//if (i == 5 || i == ba.size() - 2)
// str += " ";
int
c
=
byte
(
ba
.
at
(
i
));
str
+=
QString
(
"%1 "
).
arg
(
c
,
2
,
16
,
QChar
(
'0'
));
if
(
i
>=
8
&&
i
<
ba
.
size
()
-
2
)
ascii
+=
QChar
(
c
).
isPrint
()
?
QChar
(
c
)
:
QChar
(
'.'
);
}
if
(
size
!=
ba
.
size
())
{
str
+=
"..."
;
ascii
+=
"..."
;
}
return
str
+
" "
+
ascii
;
}
QByteArray
hexNumber
(
uint
n
,
int
digits
)
{
QByteArray
ba
=
QByteArray
::
number
(
n
,
16
);
...
...
@@ -235,32 +261,6 @@ QByteArray encode7d(const QByteArray &ba)
return
res
;
}
// FIXME: Use the QByteArray based version below?
QString
stringFromByte
(
byte
c
)
{
return
QString
(
"%1 "
).
arg
(
c
,
2
,
16
,
QChar
(
'0'
));
}
QString
stringFromArray
(
const
QByteArray
&
ba
,
int
maxLen
)
{
QString
str
;
QString
ascii
;
const
int
size
=
maxLen
==
-
1
?
ba
.
size
()
:
qMin
(
ba
.
size
(),
maxLen
);
for
(
int
i
=
0
;
i
<
size
;
++
i
)
{
//if (i == 5 || i == ba.size() - 2)
// str += " ";
int
c
=
byte
(
ba
.
at
(
i
));
str
+=
QString
(
"%1 "
).
arg
(
c
,
2
,
16
,
QChar
(
'0'
));
if
(
i
>=
8
&&
i
<
ba
.
size
()
-
2
)
ascii
+=
QChar
(
c
).
isPrint
()
?
QChar
(
c
)
:
QChar
(
'.'
);
}
if
(
size
!=
ba
.
size
())
{
str
+=
"..."
;
ascii
+=
"..."
;
}
return
str
+
" "
+
ascii
;
}
void
appendByte
(
QByteArray
*
ba
,
byte
b
)
{
ba
->
append
(
b
);
...
...
This diff is collapsed.
Click to expand it.
src/shared/trk/trkutils.h
+
0
−
2
View file @
2eed41b6
...
...
@@ -78,8 +78,6 @@ uint extractInt(const char *data);
QString
quoteUnprintableLatin1
(
const
QByteArray
&
ba
);
// produces "xx "
QString
stringFromByte
(
byte
c
);
// produces "xx xx xx "
QString
stringFromArray
(
const
QByteArray
&
ba
,
int
maxLen
=
-
1
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment