mirror of
https://github.com/ksherlock/x65.git
synced 2025-01-13 20:32:00 +00:00
Added visual studio natvis for struse class
This commit is contained in:
parent
b4407f7cb5
commit
c226b00dad
7
struse.h
7
struse.h
@ -75,8 +75,8 @@ protected:
|
||||
|
||||
public:
|
||||
strref() { clear(); }
|
||||
strref(const char *str);
|
||||
strref(char *str) : strref((const char*)str) {}
|
||||
strref(const char *str) { set(str); }
|
||||
strref(char *str) { set((const char*)str); }
|
||||
strref(const char *str, strl_t len) : string(str), length(len) {}
|
||||
strref(const char *str, int len) : string(str), length(strl_t(len)) {}
|
||||
strref(char *str, int len) : string((const char*)str), length(strl_t(len)) {}
|
||||
@ -84,6 +84,7 @@ public:
|
||||
|
||||
bool valid() const { return string && length; }
|
||||
void clear() { string = nullptr; length = 0; }
|
||||
void set(const char *str);
|
||||
const char* get() const { return string; }
|
||||
const uint8_t* get_u() const { return (const uint8_t*)string; }
|
||||
strl_t get_len() const { return length; }
|
||||
@ -1370,7 +1371,7 @@ void strref::writeln()
|
||||
}
|
||||
|
||||
// construct a strref from const char*
|
||||
strref::strref(const char *str)
|
||||
void strref::set(const char *str)
|
||||
{
|
||||
if (!str || !*str) {
|
||||
string = nullptr;
|
||||
|
12
struse.natvis
Normal file
12
struse.natvis
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
|
||||
<Type Name="strref">
|
||||
<DisplayString>{string,[length]s}</DisplayString>
|
||||
</Type>
|
||||
<Type Name="strown<*>">
|
||||
<DisplayString>{string,[length]s}</DisplayString>
|
||||
</Type>
|
||||
<Type Name="strovl">
|
||||
<DisplayString>{string_ptr,[string_length]s}</DisplayString>
|
||||
</Type>
|
||||
</AutoVisualizer>
|
Loading…
x
Reference in New Issue
Block a user