1namespace ImGui 2{ 3 ImString::ImString() 4 : Ptr(NULL) 5 { 6 } 7 8 ImString::ImString(const ImString& rhs) 9 : Ptr(NULL) 10 { 11 if (NULL != rhs.Ptr 12 && 0 != strcmp(rhs.Ptr, "")) 13 { 14 Ptr = ImStrdup(rhs.Ptr); 15 } 16 } 17 18 ImString::ImString(const char* rhs) 19 : Ptr(NULL) 20 { 21 if (NULL != rhs 22 && 0 != strcmp(rhs, "")) 23 { 24 Ptr = ImStrdup(rhs); 25 } 26 } 27 28 ImString::~ImString() 29 { 30 Clear(); 31 } 32 33 ImString& ImString::operator=(const ImString& rhs) 34 { 35 if (this != &rhs) 36 { 37 *this = rhs.Ptr; 38 } 39 40 return *this; 41 } 42 43 ImString& ImString::operator=(const char* rhs) 44 { 45 if (Ptr != rhs) 46 { 47 Clear(); 48 49 if (NULL != rhs 50 && 0 != strcmp(rhs, "")) 51 { 52 Ptr = ImStrdup(rhs); 53 } 54 } 55 56 return *this; 57 } 58 59 void ImString::Clear() 60 { 61 if (NULL != Ptr) 62 { 63 MemFree(Ptr); 64 Ptr = NULL; 65 } 66 } 67 68 bool ImString::IsEmpty() const 69 { 70 return NULL == Ptr; 71 } 72} // namespace 73 74#include "widgets/color_picker.inl" 75#include "widgets/color_wheel.inl" 76#include "widgets/dock.inl" 77#include "widgets/file_list.inl" 78#include "widgets/gizmo.inl" 79#include "widgets/markdown.inl" 80#include "widgets/memory_editor.inl" 81#include "widgets/range_slider.inl" 82