From fc662341e6f85da78ada0e443f6116b978f79f22 Mon Sep 17 00:00:00 2001 From: Igor Pavlov <87184205+ip7z@users.noreply.github.com> Date: Tue, 14 May 2024 00:00:00 +0000 Subject: 24.05 --- CPP/Common/MyString.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'CPP/Common/MyString.h') diff --git a/CPP/Common/MyString.h b/CPP/Common/MyString.h index e5ce18a..ba9914e 100644 --- a/CPP/Common/MyString.h +++ b/CPP/Common/MyString.h @@ -281,6 +281,8 @@ class AString void ReAlloc(unsigned newLimit); void ReAlloc2(unsigned newLimit); void SetStartLen(unsigned len); + + Z7_NO_INLINE void Grow_1(); void Grow(unsigned n); @@ -373,6 +375,8 @@ public: void SetFromWStr_if_Ascii(const wchar_t *s); // void SetFromBstr_if_Ascii(BSTR s); +// private: + Z7_FORCE_INLINE AString &operator+=(char c) { if (_limit == _len) @@ -384,14 +388,16 @@ public: _len = len; return *this; } - +public: void Add_Space(); void Add_Space_if_NotEmpty(); void Add_OptSpaced(const char *s); + void Add_Char(char c); void Add_LF(); void Add_Slash(); void Add_Dot(); void Add_Minus(); + void Add_Colon(); void Add_PathSepar() { operator+=(CHAR_PATH_SEPARATOR); } AString &operator+=(const char *s); @@ -402,6 +408,7 @@ public: void AddFrom(const char *s, unsigned len); // no check void SetFrom(const char *s, unsigned len); // no check + void SetFrom_Chars_SizeT(const char* s, size_t len); // no check void SetFrom(const char* s, int len) // no check { SetFrom(s, (unsigned)len); // no check @@ -668,6 +675,8 @@ public: UString &operator=(const char *s); UString &operator=(const AString &s) { return operator=(s.Ptr()); } +// private: + Z7_FORCE_INLINE UString &operator+=(wchar_t c) { if (_limit == _len) @@ -680,12 +689,17 @@ public: return *this; } - UString &operator+=(char c) { return (*this)+=((wchar_t)(unsigned char)c); } - +private: + UString &operator+=(char c); // { return (*this)+=((wchar_t)(unsigned char)c); } +public: + void Add_Char(char c); + // void Add_WChar(wchar_t c); void Add_Space(); void Add_Space_if_NotEmpty(); void Add_LF(); void Add_Dot(); + void Add_Minus(); + void Add_Colon(); void Add_PathSepar() { operator+=(WCHAR_PATH_SEPARATOR); } UString &operator+=(const wchar_t *s); -- cgit v1.2.3-55-g6feb