aboutsummaryrefslogtreecommitdiff
path: root/CPP/Common/MyString.h
diff options
context:
space:
mode:
authorIgor Pavlov <87184205+ip7z@users.noreply.github.com>2024-05-14 00:00:00 +0000
committerIgor Pavlov <87184205+ip7z@users.noreply.github.com>2024-05-15 23:55:04 +0500
commitfc662341e6f85da78ada0e443f6116b978f79f22 (patch)
tree1be1cc402a7a9cbc18d4eeea6b141354c2d559e3 /CPP/Common/MyString.h
parent5b39dc76f1bc82f941d5c800ab9f34407a06b53a (diff)
download7zip-24.05.tar.gz
7zip-24.05.tar.bz2
7zip-24.05.zip
24.0524.05
Diffstat (limited to 'CPP/Common/MyString.h')
-rw-r--r--CPP/Common/MyString.h20
1 files changed, 17 insertions, 3 deletions
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
281 void ReAlloc(unsigned newLimit); 281 void ReAlloc(unsigned newLimit);
282 void ReAlloc2(unsigned newLimit); 282 void ReAlloc2(unsigned newLimit);
283 void SetStartLen(unsigned len); 283 void SetStartLen(unsigned len);
284
285 Z7_NO_INLINE
284 void Grow_1(); 286 void Grow_1();
285 void Grow(unsigned n); 287 void Grow(unsigned n);
286 288
@@ -373,6 +375,8 @@ public:
373 void SetFromWStr_if_Ascii(const wchar_t *s); 375 void SetFromWStr_if_Ascii(const wchar_t *s);
374 // void SetFromBstr_if_Ascii(BSTR s); 376 // void SetFromBstr_if_Ascii(BSTR s);
375 377
378// private:
379 Z7_FORCE_INLINE
376 AString &operator+=(char c) 380 AString &operator+=(char c)
377 { 381 {
378 if (_limit == _len) 382 if (_limit == _len)
@@ -384,14 +388,16 @@ public:
384 _len = len; 388 _len = len;
385 return *this; 389 return *this;
386 } 390 }
387 391public:
388 void Add_Space(); 392 void Add_Space();
389 void Add_Space_if_NotEmpty(); 393 void Add_Space_if_NotEmpty();
390 void Add_OptSpaced(const char *s); 394 void Add_OptSpaced(const char *s);
395 void Add_Char(char c);
391 void Add_LF(); 396 void Add_LF();
392 void Add_Slash(); 397 void Add_Slash();
393 void Add_Dot(); 398 void Add_Dot();
394 void Add_Minus(); 399 void Add_Minus();
400 void Add_Colon();
395 void Add_PathSepar() { operator+=(CHAR_PATH_SEPARATOR); } 401 void Add_PathSepar() { operator+=(CHAR_PATH_SEPARATOR); }
396 402
397 AString &operator+=(const char *s); 403 AString &operator+=(const char *s);
@@ -402,6 +408,7 @@ public:
402 408
403 void AddFrom(const char *s, unsigned len); // no check 409 void AddFrom(const char *s, unsigned len); // no check
404 void SetFrom(const char *s, unsigned len); // no check 410 void SetFrom(const char *s, unsigned len); // no check
411 void SetFrom_Chars_SizeT(const char* s, size_t len); // no check
405 void SetFrom(const char* s, int len) // no check 412 void SetFrom(const char* s, int len) // no check
406 { 413 {
407 SetFrom(s, (unsigned)len); // no check 414 SetFrom(s, (unsigned)len); // no check
@@ -668,6 +675,8 @@ public:
668 UString &operator=(const char *s); 675 UString &operator=(const char *s);
669 UString &operator=(const AString &s) { return operator=(s.Ptr()); } 676 UString &operator=(const AString &s) { return operator=(s.Ptr()); }
670 677
678// private:
679 Z7_FORCE_INLINE
671 UString &operator+=(wchar_t c) 680 UString &operator+=(wchar_t c)
672 { 681 {
673 if (_limit == _len) 682 if (_limit == _len)
@@ -680,12 +689,17 @@ public:
680 return *this; 689 return *this;
681 } 690 }
682 691
683 UString &operator+=(char c) { return (*this)+=((wchar_t)(unsigned char)c); } 692private:
684 693 UString &operator+=(char c); // { return (*this)+=((wchar_t)(unsigned char)c); }
694public:
695 void Add_Char(char c);
696 // void Add_WChar(wchar_t c);
685 void Add_Space(); 697 void Add_Space();
686 void Add_Space_if_NotEmpty(); 698 void Add_Space_if_NotEmpty();
687 void Add_LF(); 699 void Add_LF();
688 void Add_Dot(); 700 void Add_Dot();
701 void Add_Minus();
702 void Add_Colon();
689 void Add_PathSepar() { operator+=(WCHAR_PATH_SEPARATOR); } 703 void Add_PathSepar() { operator+=(WCHAR_PATH_SEPARATOR); }
690 704
691 UString &operator+=(const wchar_t *s); 705 UString &operator+=(const wchar_t *s);