FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
daScript/src/simulate/debug_print.cpp at master · rburkholder/daScript · GitHub
rburkholder
/
daScript
Public
forked from
GaijinEntertainment/daScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
daScript
/
src
/
simulate
/
debug_print.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
58 lines (53 loc) · 1.71 KB
Breadcrumbs
daScript
/
src
/
simulate
/
debug_print.cpp
Copy path
File metadata and controls
58 lines (53 loc) · 1.71 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#
include
"
daScript/misc/platform.h
"
#
include
"
daScript/simulate/debug_print.h
"
#
include
"
daScript/misc/fpe.h
"
#
include
"
daScript/misc/debug_break.h
"
namespace
das
{
string
human_readable_formatting
(
const
string & str ) {
string result;
string tab;
auto
it = str.
begin
();
auto
tail = str.
end
();
while
( it != tail ) {
while
( it!=tail && *it==
'
'
) {
it ++;
}
while
( it!=tail && *it!=
'
\n
'
) {
auto
Ch = *it;
result += Ch;
if
( Ch==
'
[
'
) tab +=
"
"
;
else
if
( Ch==
'
]
'
) {
if
( tab.
size
()>=
2
) tab.
resize
(tab.
size
()-
2
);
//
note: we don't track mismatch
}
it ++;
}
if
( it == tail )
break
;
while
( it!=tail && *it==
'
\n
'
) {
it ++;
}
result +=
"
\n
"
;
result += tab;
}
return
result;
}
string
debug_value
(
void
* pX, TypeInfo * info, PrintFlags flags ) {
TextWriter ss;
DebugDataWalker<TextWriter>
walker
(ss,flags);
walker.
walk
((
char
*)pX,info);
if
(
int
(flags) &
int
(PrintFlags::namesAndDimensions) ) {
return
human_readable_formatting
(ss.
str
());
}
else
{
return
ss.
str
();
}
}
string
debug_value
( vec4f value, TypeInfo * info, PrintFlags flags ) {
TextWriter ss;
DebugDataWalker<TextWriter>
walker
(ss,flags);
walker.
walk
(value,info);
if
(
int
(flags) &
int
(PrintFlags::namesAndDimensions) ) {
return
human_readable_formatting
(ss.
str
());
}
else
{
return
ss.
str
();
}
}
}
Back
|
FazBrowse Home
|
New Git URL