PLCnext API Documentation  21.6.0.46
BasicString.hxx
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include <string>
8 #include <algorithm>
9 #include <memory>
10 #include <iostream>
11 #include <initializer_list>
12 #include "boost/algorithm/string/replace.hpp"
13 #include "Arp/System/Core/BasicFormatter.hxx"
14 #include "Arp/System/Core/Impl/BasicStringFormatExceptionHandler.hpp"
15 
16 #ifndef ARP_INSIDE_ARP_H
17  #error Never include 'BasicString.hxx' directly, just include 'Arp.h'
18 #endif
19 
20 namespace Arp
21 {
22 
24 
27 
30 template<class C, class Alloc = std::allocator<C>>
31 class BasicString
32 {
33 public: // typedefs
34  using Allocator = Alloc;
35  using AllocatorTraits = std::allocator_traits<Alloc>;
36  using CharType = C;
38  using BaseString = std::basic_string<CharType, std::char_traits<CharType>, Allocator>;
39 
40 public: // policy typedefs
42  using value_type = CharType;
43  using size_type = typename BaseString::size_type;
44  using difference_type = typename BaseString::difference_type;
45  using reference = typename BaseString::reference;
46  using const_reference = typename BaseString::const_reference;
47  using pointer = typename AllocatorTraits::pointer;
48  using const_pointer = typename AllocatorTraits::const_pointer;
49  using iterator = typename BaseString::iterator;
50  using const_iterator = typename BaseString::const_iterator;
51  using reverse_iterator = typename BaseString::reverse_iterator;
52  using const_reverse_iterator = typename BaseString::const_reverse_iterator;
53 
54 private: // usings
56 
57 public: // construction/destruction
59  BasicString() = default;
60 
63  BasicString(const SelfType& arg) = default;
64 
68  BasicString(const SelfType& arg, const Allocator& alloc)
69  : baseString(arg.baseString, alloc)
70  {
71  }
72 
75  explicit BasicString(const Allocator& alloc)
76  : baseString(alloc)
77  {
78  }
79 
84  BasicString(const SelfType& arg, size_type offset, size_type count = NPos)
85  : baseString(arg.baseString, offset, count)
86  {
87  }
88 
94  BasicString(const SelfType& arg, size_type offset, size_type count, const Allocator& alloc)
95  : baseString(arg.baseString, offset, count, alloc)
96  {
97  }
98 
102  BasicString(const CharType* pChars, size_type count)
103  : baseString(pChars, count)
104  {
105  }
106 
111  BasicString(const CharType* pChars, size_type count, const Allocator& alloc)
112  : baseString(pChars, count, alloc)
113  {
114  }
115 
118  BasicString(const CharType* pChars)
119  : baseString(pChars)
120  {
121  }
122 
126  BasicString(const CharType* pChars, const Allocator& alloc)
127  : baseString(pChars, alloc)
128  {
129  }
130 
135  : baseString(count, c)
136  {
137  }
138 
143  BasicString(size_type count, CharType c, const Allocator& alloc)
144  : baseString(count, c, alloc)
145  {
146  }
147 
150  BasicString(SelfType&& arg) noexcept = default;
151 
155  BasicString(SelfType&& arg, const Allocator& alloc)
156  : baseString(std::move(arg.baseString), alloc)
157  {
158  }
159 
163  BasicString(std::initializer_list<CharType> arg, const Allocator& alloc = Allocator())
164  : baseString(arg, alloc)
165  {
166  }
167 
172  BasicString(iterator first, iterator last, const Allocator& alloc = Allocator())
173  : baseString(first, last, alloc)
174  {
175  }
176 
181  BasicString(const_iterator first, const_iterator last, const Allocator& alloc = Allocator())
182  : baseString(first, last, alloc)
183  {
184  }
185 
189  : baseString(arg)
190  {
191  }
192 
196  : baseString(std::move(arg))
197  {
198  }
199 
201  ~BasicString() = default;
202 
203 public: // static fields
208  static const size_type NPos = size_type(-1);
212  static const SelfType Empty;
216  static const SelfType NewLine;
217 
218 public: // assignment operator
222  SelfType& operator=(SelfType&& right) noexcept = default;
223 
227  SelfType& operator=(std::initializer_list<CharType> right)
228  {
229  this->baseString = right;
230  return (*this);
231  }
232 
236  SelfType& operator=(const SelfType& right) = default;
237 
241  SelfType& operator=(const CharType* right)
242  {
243  this->baseString = right;
244  return (*this);
245  }
246 
251  {
252  this->baseString = c;
253  return (*this);
254  }
255 
256 public: // append operator
260  SelfType& operator+=(std::initializer_list<CharType> right)
261  {
262  this->baseString += right;
263  return (*this);
264  }
265 
269  SelfType& operator+=(const SelfType& right)
270  {
271  this->baseString += right.baseString;
272  return (*this);
273  }
274 
278  SelfType& operator+=(const CharType* right)
279  {
280  this->baseString += right;
281  return (*this);
282  }
283 
288  {
289  this->baseString += c;
290  return (*this);
291  }
292 
293 public: // assign operations
294 
299  {
300  this->baseString = std::move(arg.baseString);
301  return *this;
302  }
303 
307  SelfType& Assign(std::initializer_list<CharType> arg)
308  {
309  this->baseString.assign(arg);
310  return *this;
311  }
312 
316  SelfType& Assign(const SelfType& arg)
317  {
318  this->baseString.assign(arg.baseString);
319  return *this;
320  }
321 
326  SelfType& Assign(const SelfType& arg, size_type offset, size_type count = NPos)
327  {
328  this->baseString.assign(arg.baseString, offset, count);
329  return *this;
330  }
331 
336  {
337  this->baseString.assign(arg);
338  return *this;
339  }
340 
345  {
346  this->baseString.assign(std::move(arg));
347  return *this;
348  }
349 
353  SelfType& Assign(const CharType* pChars, size_type count)
354  {
355  this->baseString.assign(pChars, count);
356  return *this;
357  }
358 
361  SelfType& Assign(const CharType* pChars)
362  {
363  this->baseString.assign(pChars);
364  return *this;
365  }
366 
371  {
372  this->baseString.assign(count, c);
373  return *this;
374  }
375 
380  {
381  this->baseString.assign(first, last);
382  return *this;
383  }
384 
389  {
390  this->baseString.assign(first, last);
391  return *this;
392  }
393 
398  {
399  this->baseString.assign(first, last);
400  return *this;
401  }
402 
403 public: // append operations
404 
408  SelfType& Append(std::initializer_list<CharType> arg)
409  {
410  this->baseString.append(arg);
411  return *this;
412  }
413 
417  SelfType& Append(const SelfType& arg)
418  {
419  this->baseString.append(arg.baseString);
420  return *this;
421  }
422 
427  SelfType& Append(const SelfType& arg, size_type offset, size_type count = NPos)
428  {
429  this->baseString.append(arg.baseString, offset, count);
430  return *this;
431  }
432 
436  SelfType& Append(const CharType* pChars, size_type count)
437  {
438  this->baseString.append(pChars, count);
439  return *this;
440  }
441 
444  SelfType& Append(const CharType* pChars)
445  {
446  this->baseString.append(pChars);
447  return *this;
448  }
449 
454  {
455  this->baseString.append(count, c);
456  return *this;
457  }
458 
463  {
464  this->baseString.append(first, last);
465  return *this;
466  }
467 
472  {
473  this->baseString.append(first, last);
474  return *this;
475  }
476 
481  {
482  this->baseString.append(first, last);
483  return *this;
484  }
485 
486 public: // insert operations
487 
492  iterator Insert(const_iterator where, std::initializer_list<CharType> arg)
493  {
494  return this->baseString.insert(where, arg);
495  }
496 
501  SelfType& Insert(size_type offset, const SelfType& arg)
502  {
503  this->baseString.insert(offset, arg.baseString);
504  return *this;
505  }
506 
513  SelfType& Insert(size_type offset, const SelfType& arg, size_type argOffset, size_type count = NPos)
514  {
515  this->baseString.insert(offset, arg.baseString, argOffset, count);
516  return *this;
517  }
518 
524  SelfType& Insert(size_type offset, const CharType* pChars, size_type count)
525  {
526  this->baseString.insert(offset, pChars, count);
527  return *this;
528  }
529 
534  SelfType& Insert(size_type offset, const CharType* pChars)
535  {
536  this->baseString.insert(offset, pChars);
537  return *this;
538  }
539 
546  {
547  this->baseString.insert(offset, count, c);
548  return *this;
549  }
550 
556  {
557  return this->baseString.insert(where, c);
558  }
559 
566  {
567  return this->baseString.insert(where, count, c);
568  }
569 
576  {
577  return this->baseString.insert(where, first, last);
578  }
579 
586  {
587  return this->baseString.insert(where, first, last);
588  }
589 
596  {
597  return this->baseString.insert(where, first, last);
598  }
599 
600 public: // erase operations
601 
605  SelfType& Erase(size_type offset = 0)
606  {
607  this->baseString.erase(offset);
608  return (*this);
609  }
610 
616  {
617  this->baseString.erase(offset, count);
618  return (*this);
619  }
620 
625  {
626  return this->baseString.erase(where);
627  }
628 
634  {
635  return this->baseString.erase(first, last);
636  }
637 
638 public: // replace operation
639 
645  SelfType& Replace(const_iterator first, const_iterator last, std::initializer_list<CharType> chars)
646  {
647  this->baseString.replace(first, last, chars);
648  return *this;
649  }
650 
656  SelfType& Replace(size_type offset, size_type length, const SelfType& arg)
657  {
658  this->baseString.replace(offset, length, arg.baseString);
659  return (*this);
660  }
661 
669  SelfType& Replace(size_type offset, size_type length, const SelfType& arg, size_type offsetArg, size_type count = NPos)
670  {
671  this->baseString.replace(offset, length, arg.baseString, offsetArg, count);
672  return (*this);
673  }
674 
681  SelfType& Replace(size_type offset, size_type length, const CharType* pChars, size_type count)
682  {
683  this->baseString.replace(offset, length, pChars, offset, count);
684  return (*this);
685  }
686 
692  SelfType& Replace(size_type offset, size_type length, const CharType* pChars)
693  {
694  this->baseString.replace(offset, length, pChars);
695  return (*this);
696  }
697 
705  {
706  this->baseString.replace(offset, length, count, c);
707  return (*this);
708  }
709 
716  {
717  this->baseString.replace(first, last, arg.baseString);
718  return (*this);
719  }
720 
727  SelfType& Replace(const_iterator first, const_iterator last, const CharType* pChars, size_type count)
728  {
729  this->baseString.replace(first, last, pChars, count);
730  return (*this);
731  }
732 
739  {
740  this->baseString.replace(first, last, pChars);
741  return (*this);
742  }
743 
751  {
752  this->baseString.replace(first, last, count, c);
753  return (*this);
754  }
755 
763  {
764  this->baseString.replace(first, last, first2, last2);
765  return (*this);
766  }
767 
775  {
776  this->baseString.replace(first, last, first2, last2);
777  return (*this);
778  }
779 
787  {
788  this->baseString.replace(first, last, first2, last2);
789  return (*this);
790  }
791 
799  {
800  this->baseString.replace(first, last, first2, last2);
801  return (*this);
802  }
803 
804 public: // replace_all operations
805 
811  SelfType& ReplaceAll(const SelfType& pattern, const SelfType& replacement)
812  {
813  boost::replace_all(this->baseString, pattern.baseString, replacement.baseString);
814  return (*this);
815  }
816 
817 public: // support of range based for loops
818 
823  {
824  return this->baseString.begin();
825  }
826 
831  {
832  return this->baseString.begin();
833  }
834 
839  {
840  return this->baseString.end();
841  }
842 
847  {
848  return this->baseString.end();
849  }
850 
851 public: // container operations
852 
856  {
857  return this->baseString.begin();
858  }
859 
863  {
864  return this->baseString.begin();
865  }
866 
870  {
871  return this->baseString.end();
872  }
873 
877  {
878  return this->baseString.end();
879  }
880 
884  {
885  return this->baseString.rbegin();
886  }
887 
891  {
892  return this->baseString.rbegin();
893  }
894 
898  {
899  return this->baseString.rend();
900  }
901 
905  {
906  return this->baseString.rend();
907  }
908 
912  {
913  return this->baseString.cbegin();
914  }
915 
919  {
920  return this->baseString.cend();
921  }
922 
926  {
927  return this->baseString.crbegin();
928  }
929 
933  {
934  return this->baseString.crend();
935  }
936 
938  void ShrinkToFit()
939  {
940  this->baseString.shrink_to_fit();
941  }
942 
946  {
947  this->baseString.push_back(c);
948  }
949 
952  void PopBack()
953  {
954  if(!this->IsEmpty())
955  {
956  this->baseString.pop_back();
957  }
958  }
959 
964  {
965  return this->baseString.front();
966  }
967 
972  {
973  return this->baseString.front();
974  }
975 
980  {
981  return this->baseString.back();
982  }
983 
988  {
989  return this->baseString.back();
990  }
991 
997  {
998  return this->baseString.at(offset);
999  }
1000 
1006  {
1007  return this->baseString.at(offset);
1008  }
1009 
1015  {
1016  return this->baseString[offset];
1017  }
1018 
1024  {
1025  return this->baseString[offset];
1026  }
1027 
1028 public: // Size/Length operations
1029 
1038  {
1039  return this->baseString.length();
1040  }
1041 
1049  size_type Size() const
1050  {
1051  return this->baseString.size();
1052  }
1053 
1056  {
1057  return this->baseString.max_size();
1058  }
1059 
1068  {
1069  return this->baseString.capacity();
1070  }
1071 
1074  bool IsEmpty() const
1075  {
1076  return this->baseString.empty();
1077  }
1078 
1085  void Resize(size_type newSize)
1086  {
1087  this->baseString.resize(newSize);
1088  }
1089 
1097  void Resize(size_type newSize, CharType c)
1098  {
1099  this->baseString.resize(newSize, c);
1100  }
1101 
1109  void Reserve(size_type newCapacity = 0)
1110  {
1111  this->baseString.reserve(newCapacity);
1112  }
1113 
1115  void Clear()
1116  {
1117  this->baseString.clear();
1118  }
1119 
1120 public: // Find operations
1121 
1126  size_type Find(const SelfType& pattern, size_type offset = 0) const
1127  {
1128  return this->baseString.find(pattern.baseString, offset);
1129  }
1130 
1136  size_type Find(const CharType* pChars, size_type offset, size_type count) const
1137  {
1138  return this->baseString.find(pChars, offset, count);
1139  }
1140 
1145  size_type Find(const CharType* pChars, size_type offset = 0) const
1146  {
1147  return this->baseString.find(pChars, offset);
1148  }
1149 
1154  size_type Find(CharType c, size_type offset = 0) const
1155  {
1156  return this->baseString.find(c, offset);
1157  }
1158 
1163  size_type ReverseFind(const SelfType& pattern, size_type offset = NPos) const
1164  {
1165  return this->baseString.rfind(pattern.baseString, offset);
1166  }
1167 
1173  size_type ReverseFind(const CharType* pChars, size_type offset, size_type count) const
1174  {
1175  return this->baseString.rfind(pChars, offset, count);
1176  }
1177 
1182  size_type ReverseFind(const CharType* pChars, size_type offset = NPos) const
1183  {
1184  return this->baseString.rfind(pChars, offset);
1185  }
1186 
1191  size_type ReverseFind(CharType c, size_type offset = NPos) const
1192  {
1193  return this->baseString.rfind(c, offset);
1194  }
1195 
1200  size_type FindFirstOf(const SelfType& chars, size_type offset = 0) const
1201  {
1202  return this->baseString.find_first_of(chars.baseString, offset);
1203  }
1204 
1210  size_type FindFirstOf(const CharType* pChars, size_type offset, size_type count) const
1211  {
1212  return this->baseString.find_first_of(pChars, offset, count);
1213  }
1214 
1219  size_type FindFirstOf(const CharType* pChars, size_type offset = 0) const
1220  {
1221  return this->baseString.find_first_of(pChars, offset);
1222  }
1223 
1230  {
1231  return this->baseString.find_first_of(c, offset);
1232  }
1233 
1238  size_type FindLastOf(const SelfType& chars, size_type offset = NPos) const
1239  {
1240  return this->baseString.find_last_of(chars.baseString, offset);
1241  }
1242 
1248  size_type FindLastOf(const CharType* pChars, size_type offset, size_type count) const
1249  {
1250  return this->baseString.find_last_of(pChars, offset, count);
1251  }
1252 
1257  size_type FindLastOf(const CharType* pChars, size_type offset = NPos) const
1258  {
1259  return this->baseString.find_last_of(pChars, offset);
1260  }
1261 
1267  size_type FindLastOf(CharType c, size_type offset = NPos) const
1268  {
1269  return this->baseString.find_last_of(c, offset);
1270  }
1271 
1276  size_type FindFirstNotOf(const SelfType& chars, size_type offset = 0) const
1277  {
1278  return this->baseString.find_first_not_of(chars.baseString, offset);
1279  }
1280 
1286  size_type FindFirstNotOf(const CharType* pChars, size_type offset, size_type count) const
1287  {
1288  return this->baseString.find_first_not_of(pChars, offset, count);
1289  }
1290 
1295  size_type FindFirstNotOf(const CharType *pChars, size_type offset = 0) const
1296  {
1297  return this->baseString.find_first_not_of(pChars, offset);
1298  }
1299 
1306  {
1307  return this->baseString.find_first_not_of(c, offset);
1308  }
1309 
1314  size_type FindLastNotOf(const SelfType& chars, size_type offset = NPos) const
1315  {
1316  return this->baseString.find_last_not_of(chars.baseString, offset);
1317  }
1318 
1324  size_type FindLastNotOf(const CharType *pChars, size_type offset, size_type count) const
1325  {
1326  return this->baseString.find_last_not_of(pChars, offset, count);
1327  }
1328 
1333  size_type FindLastNotOf(const CharType *pChars, size_type offset = NPos) const
1334  {
1335  return this->baseString.find_last_not_of(pChars, offset);
1336  }
1337 
1343  size_type FindLastNotOf(CharType c, size_type offset = NPos) const
1344  {
1345  return this->baseString.find_last_not_of(c, offset);
1346  }
1347 
1348 public: // Compare operations
1349 
1357  int Compare(const SelfType& other) const
1358  {
1359  return this->baseString.compare(other.baseString);
1360  }
1361 
1371  int Compare(size_type offset, size_type count, const SelfType& other) const
1372  {
1373  return this->baseString.compare(offset, count, other.baseString);
1374  }
1375 
1387  int Compare(size_type offset, size_type count, const SelfType& other, size_type offsetOther, size_type countOther = NPos) const
1388  {
1389  return this->baseString.compare(offset, count, other.baseString, offsetOther, countOther);
1390  }
1391 
1399  int Compare(const CharType *pOther) const
1400  {
1401  return this->baseString.compare(pOther);
1402  }
1403 
1413  int Compare(size_type offset, size_type count, const CharType *pOther) const
1414  {
1415  return this->baseString.compare(offset, count, pOther);
1416  }
1417 
1428  int Compare(size_type offset, size_type count, const CharType *pOther, size_type countOther) const
1429  {
1430  return this->baseString.compare(offset, count, pOther, countOther);
1431  }
1432 
1433 public: // misc operations (none std)
1434 
1438  bool StartWith(const CharType *pChars)const
1439  {
1440  return this->Find(pChars) == 0;
1441  }
1442 
1446  bool StartWith(const SelfType& pattern)const
1447  {
1448  return this->Find(pattern) == 0;
1449  }
1450 
1451 public: // Format operations
1456  template<typename... Args>
1457  static SelfType Format(const SelfType& format, const Args& ... args)
1458  {
1459  return Format(format.CStr(), args...);
1460  }
1461 
1466  template<typename... Args>
1467  static SelfType Format(const char* format, const Args& ... args)
1468  {
1469  return BasicFormatterType::FormatCommon(&BasicStringFormatExceptionHandler::Invoke, format, args...);
1470  }
1471 
1472 public: // Misc operations
1476  {
1477  return this->baseString;
1478  }
1479 
1482  const CharType* CStr() const
1483  {
1484  return this->baseString.c_str();
1485  }
1486 
1489  operator const CharType*() const
1490  {
1491  return this->baseString.data();
1492  }
1493 
1496  operator const BaseString& () const
1497  {
1498  return this->baseString;
1499  }
1500 
1505  SelfType Substr(size_type offset = 0, size_type count = NPos) const
1506  {
1507  return SelfType(this->baseString.substr(offset, count));
1508  }
1509 
1512  Allocator GetAllocator() const
1513  {
1514  return this->baseString.get_allocator();
1515  }
1516 
1519  void Swap(SelfType& other)
1520  {
1521  this->baseString.swap(other.baseString);
1522  }
1523 
1524  // warning 4996 occurs, to avoid use _SCL_SECURE_NO_WARNINGS
1525  //size_type Copy(CharType* pChars, size_type count, size_type offset = 0) const
1526  //{
1527  // return this->baseString.copy(pChars, count, offset);
1528  //}
1529 
1530 private: // fields
1531  BaseString baseString;
1532 };
1533 
1535 // initializing of static fields
1536 template <class CharType, class Alloc>
1538 
1539 template <class CharType, class Alloc>
1541 
1543 // inline global operators and functions of class BasicString<CharType, Alloc>
1544 
1548 template<class CharType, class Alloc>
1550 {
1551  left.swap(right);
1552 }
1553 
1558 template<class CharType, class Alloc>
1559 inline std::ostream& operator<<(std::ostream& os, const BasicString<CharType, Alloc>& right)
1560 {
1561  os << right.GetBaseString();
1562  return os;
1563 }
1564 
1569 template<class CharType, class Alloc>
1570 inline std::istream& operator>>(std::istream& is, BasicString<CharType, Alloc>& right)
1571 {
1572  std::basic_string<CharType, std::char_traits<CharType>, Alloc> baseString;
1573  is >> baseString;
1574  right.Assign(baseString);
1575  return is;
1576 }
1577 
1582 template<class CharType, class Alloc>
1584  const BasicString<CharType, Alloc>& left,
1585  const BasicString<CharType, Alloc>& right)
1586 {
1587  return left.GetBaseString() + right.GetBaseString();
1588 }
1589 
1594 template<class CharType, class Alloc>
1596  const CharType* left,
1597  const BasicString<CharType, Alloc>& right)
1598 {
1599  return left + right.GetBaseString();
1600 }
1601 
1606 template<class CharType, class Alloc>
1608  const CharType left,
1609  const BasicString<CharType, Alloc>& right)
1610 {
1611  return left + right.GetBaseString();
1612 }
1613 
1618 template<class CharType, class Alloc>
1620  const BasicString<CharType, Alloc>& left,
1621  const CharType* right)
1622 {
1623  return left.GetBaseString() + right;
1624 }
1625 
1630 template<class CharType, class Alloc>
1632  const BasicString<CharType, Alloc>& left,
1633  const CharType right)
1634 {
1635  return left.GetBaseString() + right;
1636 }
1637 
1642 template<class CharType, class Alloc>
1644  const BasicString<CharType, Alloc>& left,
1646 {
1647  return left.GetBaseString() + right.GetBaseString();
1648 }
1649 
1654 template<class CharType, class Alloc>
1657  const BasicString<CharType, Alloc>& right)
1658 {
1659  return (std::move(left.Append(right)));
1660 }
1661 
1666 template<class CharType, class Alloc>
1670 {
1671  return left.GetBaseString() + right.GetBaseString();
1672 }
1673 
1678 template<class CharType, class Alloc>
1680  const CharType* left,
1682 {
1683  return left + right.GetBaseString();
1684 }
1685 
1690 template<class CharType, class Alloc>
1692  const CharType left,
1694 {
1695  return left + right.GetBaseString();
1696 }
1697 
1702 template<class CharType, class Alloc>
1705  const CharType* right)
1706 {
1707  return left.GetBaseString() + right;
1708 }
1709 
1714 template<class CharType, class Alloc>
1717  const CharType right)
1718 {
1719  return left.GetBaseString() + right;
1720 }
1721 
1726 template<class CharType, class Alloc>
1727 inline bool operator==(
1728  const BasicString<CharType, Alloc>& left,
1729  const BasicString<CharType, Alloc>& right)
1730 {
1731  return left.GetBaseString() == right.GetBaseString();
1732 }
1733 
1738 template<class CharType, class Alloc>
1739 inline bool operator==(
1740  const CharType* left,
1741  const BasicString<CharType, Alloc>& right)
1742 {
1743  return left == right.GetBaseString();
1744 }
1745 
1750 template<class CharType, class Alloc>
1751 inline bool operator==(
1752  const BasicString<CharType, Alloc>& left,
1753  const CharType* right)
1754 {
1755  return left.GetBaseString() == right;
1756 }
1757 
1762 template<class CharType, class Alloc>
1763 inline bool operator!=(
1764  const BasicString<CharType, Alloc>& left,
1765  const BasicString<CharType, Alloc>& right)
1766 {
1767  return (!(left == right));
1768 }
1769 
1774 template<class CharType, class Alloc>
1775 inline bool operator!=(
1776  const CharType *left,
1777  const BasicString<CharType, Alloc>& right)
1778 {
1779  return (!(left == right));
1780 }
1781 
1786 template<class CharType, class Alloc>
1787 inline bool operator!=(
1788  const BasicString<CharType, Alloc>& left,
1789  const CharType* right)
1790 {
1791  return (!(left == right));
1792 }
1793 
1798 template<class CharType, class Alloc>
1799 inline bool operator<(
1800  const BasicString<CharType, Alloc>& left,
1801  const BasicString<CharType, Alloc>& right)
1802 {
1803  return left.GetBaseString() < right.GetBaseString();
1804 }
1805 
1810 template<class CharType, class Alloc>
1811 inline bool operator<(
1812  const CharType* left,
1813  const BasicString<CharType, Alloc>& right)
1814 {
1815  return left < right.GetBaseString();
1816 }
1817 
1822 template<class CharType, class Alloc>
1823 inline bool operator<(
1824  const BasicString<CharType, Alloc>& left,
1825  const CharType* right)
1826 {
1827  return left.GetBaseString() < right;
1828 }
1829 
1834 template<class CharType, class Alloc>
1835 inline bool operator>(
1836  const BasicString<CharType, Alloc>& left,
1837  const BasicString<CharType, Alloc>& right)
1838 {
1839  return (right < left);
1840 }
1841 
1846 template<class CharType, class Alloc>
1847 inline bool operator>(
1848  const CharType* left,
1849  const BasicString<CharType, Alloc>& right)
1850 {
1851  return (right < left);
1852 }
1853 
1858 template<class CharType, class Alloc>
1859 inline bool operator>(
1860  const BasicString<CharType, Alloc>& left,
1861  const CharType* right)
1862 {
1863  return (right < left);
1864 }
1865 
1870 template<class CharType, class Alloc>
1871 inline bool operator<=(
1872  const BasicString<CharType, Alloc>& left,
1873  const BasicString<CharType, Alloc>& right)
1874 {
1875  return (!(right < left));
1876 }
1877 
1882 template<class CharType, class Alloc>
1883 inline bool operator<=(
1884  const CharType* left,
1885  const BasicString<CharType, Alloc>& right)
1886 {
1887  return (!(right < left));
1888 }
1889 
1894 template<class CharType, class Alloc>
1895 inline bool operator<=(
1896  const BasicString<CharType, Alloc>& left,
1897  const CharType* right)
1898 {
1899  return (!(right < left));
1900 }
1901 
1906 template<class CharType, class Alloc>
1907 inline bool operator>=(
1908  const BasicString<CharType, Alloc>& left,
1909  const BasicString<CharType, Alloc>& right)
1910 {
1911  return (!(left < right));
1912 }
1913 
1918 template<class CharType, class Alloc>
1919 inline bool operator>=(
1920  const CharType* left,
1921  const BasicString<CharType, Alloc>& right)
1922 {
1923  return (!(left < right));
1924 }
1925 
1930 template<class CharType, class Alloc>
1931 inline bool operator>=(
1932  const BasicString<CharType, Alloc>& left,
1933  const CharType* right)
1934 {
1935  return (!(left < right));
1936 }
1937 
1938 } // end of namesapce Arp
1939 
1941 // standard template specializations of class BasicString<C,Alloc>
1942 namespace std
1943 {
1944 
1948 template<class C, class Alloc>
1949 struct hash<Arp::BasicString<C, Alloc>>
1950 {
1951 private:
1953 
1954 public:
1958  typedef size_t result_type;
1959 
1960 public:
1964  result_type operator()(const argument_type& key) const
1965  {
1966  return std::hash<BaseString>()(key.GetBaseString());
1967  }
1968 };
1969 
1971 
1972 } // end of namespace std
const_reverse_iterator ReverseBegin() const
Returns the begin iterator of this string for reverse iterating.
Definition: BasicString.hxx:890
BasicString(const CharType *pChars, size_type count, const Allocator &alloc)
This constructor copies the as argument passed C-string.
Definition: BasicString.hxx:111
BasicString()=default
The default constructor constructs an empty string instance.
BasicString< CharType, Alloc > operator+(const BasicString< CharType, Alloc > &left, const BasicString< CharType, Alloc > &right)
Concatenates the right string to the left string.
Definition: BasicString.hxx:1583
BasicString(const SelfType &arg, const Allocator &alloc)
This constructor copies the as argument passed string deeply.
Definition: BasicString.hxx:68
size_type FindLastOf(CharType c, size_type offset=NPos) const
Finds the last occurence of character c .
Definition: BasicString.hxx:1267
size_type Size() const
Returns the number of char elements in this string.
Definition: BasicString.hxx:1049
static SelfType Format(const char *format, const Args &... args)
Formats the format C-string using the .NET/Python syntax with the given variadic arguments...
Definition: BasicString.hxx:1467
static const size_type NPos
This position value is returned when find operations do not match, or is used as default value for an...
Definition: BasicString.hxx:208
SelfType & Assign(const SelfType &arg)
This operation copies the the argument to this string.
Definition: BasicString.hxx:316
std::istream & operator>>(std::istream &is, BasicString< CharType, Alloc > &right)
Streams the instream is into the right string.
Definition: BasicString.hxx:1570
iterator Begin()
Returns the begin iterator of this string.
Definition: BasicString.hxx:855
SelfType & Replace(const_iterator first, const_iterator last, const CharType *pChars, size_type count)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:727
SelfType & Replace(const_iterator first, const_iterator last, const CharType *pChars)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:738
SelfType & operator+=(const CharType *right)
This assignment operator appends the the right-hand-side operand to this string.
Definition: BasicString.hxx:278
SelfType & operator+=(const SelfType &right)
This assignment operator appends the the right-hand-side operand to this string.
Definition: BasicString.hxx:269
size_type FindLastNotOf(CharType c, size_type offset=NPos) const
Finds the last occurence of any character which is not equal to c .
Definition: BasicString.hxx:1343
SelfType & Replace(const_iterator first, const_iterator last, iterator first2, iterator last2)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:762
size_type Find(const CharType *pChars, size_type offset=0) const
Finds the first substring which equal to pChars .
Definition: BasicString.hxx:1145
static const SelfType NewLine
This static string instance represents the (platform specific) new line string.
Definition: BasicString.hxx:216
SelfType & Replace(const_iterator first, const_iterator last, size_type count, CharType c)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:750
bool operator!=(const BasicString< CharType, Alloc > &left, const BasicString< CharType, Alloc > &right)
Compares the left string to the right string on inequality.
Definition: BasicString.hxx:1763
SelfType & Insert(size_type offset, const CharType *pChars)
This operation inserts the as argument passed string.
Definition: BasicString.hxx:534
SelfType & Erase(size_type offset, size_type count)
This operation erases chars from this string.
Definition: BasicString.hxx:615
const_reference Back() const
Returns a const reference to the last character in the string.
Definition: BasicString.hxx:987
SelfType & Append(size_type count, CharType c)
Appends to this string count consecutive copies of character c .
Definition: BasicString.hxx:453
SelfType & Replace(size_type offset, size_type length, const CharType *pChars, size_type count)
Replaces a range of chars.
Definition: BasicString.hxx:681
typename BaseString::const_reference const_reference
The const reference type of this type.
Definition: BasicString.hxx:46
BasicString(std::initializer_list< CharType > arg, const Allocator &alloc=Allocator())
Copies each of the characters in initList , in the same order.
Definition: BasicString.hxx:163
~BasicString()=default
The destructor deallocates all memory of this instance.
size_type MaxSize() const
Returns the number maximum size any string might have.
Definition: BasicString.hxx:1055
int Compare(size_type offset, size_type count, const CharType *pOther) const
Compares this string to the pOther string lexicographical.
Definition: BasicString.hxx:1413
SelfType & Replace(size_type offset, size_type length, const SelfType &arg, size_type offsetArg, size_type count=NPos)
Replaces a range of chars.
Definition: BasicString.hxx:669
size_type FindLastOf(const CharType *pChars, size_type offset, size_type count) const
Finds the last occurence of any character in pChars .
Definition: BasicString.hxx:1248
SelfType & operator=(SelfType &&right) noexcept=default
This move assignment operator moves the right-hand-side operand to this string.
SelfType & Assign(SelfType &&arg)
This operation moves the as argument passed string to this string.
Definition: BasicString.hxx:298
int Compare(size_type offset, size_type count, const SelfType &other, size_type offsetOther, size_type countOther=NPos) const
Compares a substring of this string to a substring of the other string lexicographical.
Definition: BasicString.hxx:1387
SelfType & Assign(const_pointer first, const_pointer last)
Copies the sequence of characters in the range [first,last), in the same order.
Definition: BasicString.hxx:397
SelfType & Append(std::initializer_list< CharType > arg)
This operation appends each of the characters in the argument to this string, in the same order...
Definition: BasicString.hxx:408
int Compare(size_type offset, size_type count, const SelfType &other) const
Compares this string to the other string lexicographical.
Definition: BasicString.hxx:1371
SelfType & Append(const_iterator first, const_iterator last)
Appends the sequence of characters in the range [first,last), in the same order.
Definition: BasicString.hxx:471
This class encapsulates formatting operations which are based on the open source library libfmt forme...
Definition: BasicFormatter.hxx:26
reference Back()
Returns a reference to the last character in the string.
Definition: BasicString.hxx:979
SelfType & Assign(const BaseString &arg)
This operation copies the argument to this string.
Definition: BasicString.hxx:335
Namespace of the C++ standard library
typename BaseString::const_iterator const_iterator
The const iterator type of this type.
Definition: BasicString.hxx:50
SelfType Substr(size_type offset=0, size_type count=NPos) const
Gets a substring of this string.
Definition: BasicString.hxx:1505
size_type ReverseFind(CharType c, size_type offset=NPos) const
Finds the last char which equal to c .
Definition: BasicString.hxx:1191
const_iterator End() const
Returns the end iterator of this string.
Definition: BasicString.hxx:876
size_type FindFirstOf(const CharType *pChars, size_type offset, size_type count) const
Finds the first occurence of any character in pChars .
Definition: BasicString.hxx:1210
Definition: BasicFormatter.hxx:18
typename BaseString::const_reverse_iterator const_reverse_iterator
The const reverse iterator type of this type.
Definition: BasicString.hxx:52
BasicString(const SelfType &arg, size_type offset, size_type count, const Allocator &alloc)
This constructor copies the as argument passed string partially.
Definition: BasicString.hxx:94
size_type FindFirstOf(const CharType *pChars, size_type offset=0) const
Finds the first occurence of any character in pChars .
Definition: BasicString.hxx:1219
Allocator allocator_type
The allocator type of this type.
Definition: BasicString.hxx:41
iterator end()
Returns the end iterator of this string.
Definition: BasicString.hxx:838
bool operator>(const BasicString< CharType, Alloc > &left, const BasicString< CharType, Alloc > &right)
Compares the left string to the right string.
Definition: BasicString.hxx:1835
iterator Insert(const_iterator where, const_iterator first, const_iterator last)
Inserts a range of chars [first;last) at position where .
Definition: BasicString.hxx:585
const_iterator ConstEnd() const
Returns the end iterator of this const string.
Definition: BasicString.hxx:918
bool operator<(const BasicString< CharType, Alloc > &left, const BasicString< CharType, Alloc > &right)
Compares the left string to the right string.
Definition: BasicString.hxx:1799
bool StartWith(const SelfType &pattern) const
Determines if this string starts with the pattern string.
Definition: BasicString.hxx:1446
typename AllocatorTraits::const_pointer const_pointer
The const pointer type of this type.
Definition: BasicString.hxx:48
size_type FindFirstOf(const SelfType &chars, size_type offset=0) const
Finds the first occurence of any character in chars .
Definition: BasicString.hxx:1200
int Compare(const SelfType &other) const
Compares this string to the other string lexicographical.
Definition: BasicString.hxx:1357
size_type FindFirstOf(CharType c, size_type offset=0) const
Finds the first occurence of character c .
Definition: BasicString.hxx:1229
size_t result_type
The result type of this functor class (stl policy type)
Definition: BasicString.hxx:1958
size_type FindLastOf(const SelfType &chars, size_type offset=NPos) const
Finds the last occurence of any character in chars .
Definition: BasicString.hxx:1238
reference At(size_type offset)
Returns a const reference to the character at position offset .
Definition: BasicString.hxx:996
size_type Find(CharType c, size_type offset=0) const
Finds the first char which equal to c .
Definition: BasicString.hxx:1154
void Reserve(size_type newCapacity=0)
Reserves memory upto the specified newCapacity .
Definition: BasicString.hxx:1109
const CharType * CStr() const
Gets the character data of this string.
Definition: BasicString.hxx:1482
SelfType & Append(const_pointer first, const_pointer last)
Appends the sequence of characters in the range [first,last), in the same order.
Definition: BasicString.hxx:480
void Swap(SelfType &other)
Swaps the content of this string with the content of the other string.
Definition: BasicString.hxx:1519
Definition: BasicStringFormatExceptionHandler.hpp:15
const BaseString & GetBaseString() const
Gets the basic std string.
Definition: BasicString.hxx:1475
iterator Insert(const_iterator where, const_pointer first, const_pointer last)
Inserts a range of chars [first;last) at position where .
Definition: BasicString.hxx:595
size_type Find(const SelfType &pattern, size_type offset=0) const
Finds the first substring which equal to pattern .
Definition: BasicString.hxx:1126
reverse_iterator ReverseBegin()
Returns the begin iterator of this string for reverse iterating.
Definition: BasicString.hxx:883
SelfType & Erase(size_type offset=0)
This operation erases chars from this string.
Definition: BasicString.hxx:605
size_type FindLastNotOf(const CharType *pChars, size_type offset=NPos) const
Finds the last occurence of any character which is not in pChars .
Definition: BasicString.hxx:1333
bool IsEmpty() const
Determines if this string is empty.
Definition: BasicString.hxx:1074
typename BaseString::reference reference
The reference type of this type.
Definition: BasicString.hxx:45
SelfType & operator+=(CharType c)
This assignment operator appends the the right-hand-side operand to this string.
Definition: BasicString.hxx:287
SelfType & Append(const SelfType &arg)
This operation appends the the argument to this string.
Definition: BasicString.hxx:417
typename BaseString::reverse_iterator reverse_iterator
The reverse iterator type of this type.
Definition: BasicString.hxx:51
void Resize(size_type newSize, CharType c)
Resizes this string to the specified new size.
Definition: BasicString.hxx:1097
CharType value_type
The char type of this type.
Definition: BasicString.hxx:42
iterator Insert(const_iterator where, size_type count, CharType c)
Inserts character c at position where .
Definition: BasicString.hxx:565
static const SelfType Empty
An emtpy static string instance.
Definition: BasicString.hxx:212
SelfType & Replace(const_iterator first, const_iterator last, const_pointer first2, const_pointer last2)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:786
void ShrinkToFit()
Reduces the capacity of this string to its size.
Definition: BasicString.hxx:938
iterator Erase(const_iterator first, const_iterator last)
Erases a range of chars [first;last).
Definition: BasicString.hxx:633
BasicString(size_type count, CharType c)
Fills the string with count consecutive copies of character c .
Definition: BasicString.hxx:134
size_type FindFirstNotOf(const CharType *pChars, size_type offset=0) const
Finds the first occurence of any character which is not in pChars .
Definition: BasicString.hxx:1295
Allocator GetAllocator() const
Gets the allocator of this string.
Definition: BasicString.hxx:1512
BasicString(const_iterator first, const_iterator last, const Allocator &alloc=Allocator())
Copies the sequence of characters in the range [first,last), in the same order..
Definition: BasicString.hxx:181
reference operator[](size_type offset)
Returns a reference to the character at position offset .
Definition: BasicString.hxx:1014
void PushBack(CharType c)
Appends the character c to this string.
Definition: BasicString.hxx:945
typename AllocatorTraits::pointer pointer
The pointer type of this type.
Definition: BasicString.hxx:47
bool StartWith(const CharType *pChars) const
Determines if this string starts with the pChars C-string.
Definition: BasicString.hxx:1438
iterator Erase(const_iterator where)
This operation erases chars from this string.
Definition: BasicString.hxx:624
void Clear()
Clears the content of this string, but does not modify the capacity.
Definition: BasicString.hxx:1115
size_type ReverseFind(const SelfType &pattern, size_type offset=NPos) const
Finds the last substring which equal to pattern .
Definition: BasicString.hxx:1163
iterator End()
Returns the end iterator of this string.
Definition: BasicString.hxx:869
BasicString(size_type count, CharType c, const Allocator &alloc)
Fills the string with count consecutive copies of character c .
Definition: BasicString.hxx:143
size_type Find(const CharType *pChars, size_type offset, size_type count) const
Finds the first substring which equal to pChars .
Definition: BasicString.hxx:1136
size_type ReverseFind(const CharType *pChars, size_type offset=NPos) const
Finds the last substring which equal to pChars .
Definition: BasicString.hxx:1182
size_type Length() const
Returns the number of char elements in this string.
Definition: BasicString.hxx:1037
void Resize(size_type newSize)
Resizes this string to the specified new size.
Definition: BasicString.hxx:1085
SelfType & Assign(std::initializer_list< CharType > arg)
This operation copies each of the characters in the argument to this string, in the same order...
Definition: BasicString.hxx:307
void swap(BasicString< CharType, Alloc > &left, BasicString< CharType, Alloc > &right)
Swaps the content of the left string with the content of the right string.
Definition: BasicString.hxx:1549
size_type FindFirstNotOf(CharType c, size_type offset=0) const
Finds the first occurence of any character which is not equal to c .
Definition: BasicString.hxx:1305
char CharType
The character type.
Definition: BasicString.hxx:36
int Compare(size_type offset, size_type count, const CharType *pOther, size_type countOther) const
Compares a substring of this string to a substring of the pOther string lexicographical.
Definition: BasicString.hxx:1428
SelfType & ReplaceAll(const SelfType &pattern, const SelfType &replacement)
Replaces a given pattern by a replacement string.
Definition: BasicString.hxx:811
static StringType FormatCommon(ExceptionHandler exceptionHandler, const StringType &format, const Args &... args)
Uses common CLR syntax (.Net) for the placeholders in the format string like &#39;{0}&#39;.
Definition: BasicFormatter.hxx:55
size_type ReverseFind(const CharType *pChars, size_type offset, size_type count) const
Finds the last substring which equal to pChars .
Definition: BasicString.hxx:1173
SelfType & Append(const SelfType &arg, size_type offset, size_type count=NPos)
This operation appends the as argument passed string partially.
Definition: BasicString.hxx:427
static SelfType Format(const SelfType &format, const Args &... args)
Formats the format string using the .NET/Python syntax with the given variadic arguments.
Definition: BasicString.hxx:1457
BasicString(BaseString &&arg)
This move constructor moves the as argument passed std::string to this string.
Definition: BasicString.hxx:195
size_type FindLastOf(const CharType *pChars, size_type offset=NPos) const
Finds the last occurence of any character in pChars .
Definition: BasicString.hxx:1257
iterator begin()
Returns the begin iterator of this string.
Definition: BasicString.hxx:822
BasicString(const Allocator &alloc)
This constructor creates an empty string instance.
Definition: BasicString.hxx:75
size_type FindFirstNotOf(const CharType *pChars, size_type offset, size_type count) const
Finds the first occurence of any character which is not in pChars .
Definition: BasicString.hxx:1286
SelfType & Insert(size_type offset, const CharType *pChars, size_type count)
This operation inserts the as argument passed string partially.
Definition: BasicString.hxx:524
BasicString(iterator first, iterator last, const Allocator &alloc=Allocator())
Copies the sequence of characters in the range [first,last), in the same order..
Definition: BasicString.hxx:172
Root namespace for the PLCnext API
size_type Capacity() const
Rceturns the capacity of this string.
Definition: BasicString.hxx:1067
SelfType & operator=(const CharType *right)
This assignment operator copies the right-hand-side operand to this string.
Definition: BasicString.hxx:241
SelfType & Replace(const_iterator first, const_iterator last, std::initializer_list< CharType > chars)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:645
SelfType & Replace(size_type offset, size_type length, const SelfType &arg)
Replaces a range of chars.
Definition: BasicString.hxx:656
const_reverse_iterator ConstReverseEnd() const
Returns the end iterator of this const string for reverse iterating.
Definition: BasicString.hxx:932
SelfType & operator=(CharType c)
This assignment operator copies the right-hand-side operand to this string.
Definition: BasicString.hxx:250
Arp::BasicString< C, Alloc > argument_type
The argument type of this functor class (stl policy type)
Definition: BasicString.hxx:1956
const_iterator begin() const
Returns the begin iterator of this string.
Definition: BasicString.hxx:830
SelfType & Replace(const_iterator first, const_iterator last, const_iterator first2, const_iterator last2)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:774
reverse_iterator ReverseEnd()
Returns the end iterator of this string for reverse iterating.
Definition: BasicString.hxx:897
SelfType & Append(const CharType *pChars, size_type count)
This operation appends the as argument passed C-string partially.
Definition: BasicString.hxx:436
size_type FindLastNotOf(const CharType *pChars, size_type offset, size_type count) const
Finds the last occurence of any character which is not in pChars .
Definition: BasicString.hxx:1324
bool operator==(const BasicString< CharType, Alloc > &left, const BasicString< CharType, Alloc > &right)
Compares the left string to the right string on equality.
Definition: BasicString.hxx:1727
const_iterator end() const
Returns the end iterator of this string.
Definition: BasicString.hxx:846
SelfType & Assign(iterator first, iterator last)
Copies the sequence of characters in the range [first,last), in the same order.
Definition: BasicString.hxx:379
BasicString< CharType, Allocator > SelfType
The self type.
Definition: BasicString.hxx:37
SelfType & Append(const CharType *pChars)
This operation appends the as argument passed C-string.
Definition: BasicString.hxx:444
SelfType & Replace(const_iterator first, const_iterator last, pointer first2, pointer last2)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:798
SelfType & Insert(size_type offset, const SelfType &arg)
This operation inserts the the argument at the given position.
Definition: BasicString.hxx:501
bool operator>=(const BasicString< CharType, Alloc > &left, const BasicString< CharType, Alloc > &right)
Compares the left string to the right string.
Definition: BasicString.hxx:1907
const_reverse_iterator ReverseEnd() const
Returns the end iterator of this string for reverse iterating.
Definition: BasicString.hxx:904
const_reference Front() const
Returns a const reference to the first character in the string.
Definition: BasicString.hxx:971
iterator Insert(const_iterator where, iterator first, iterator last)
Inserts a range of chars [first;last) at position where .
Definition: BasicString.hxx:575
SelfType & Insert(size_type offset, size_type count, CharType c)
Inserts count consecutive copies of character c at position offset .
Definition: BasicString.hxx:545
SelfType & Replace(size_type offset, size_type length, size_type count, CharType c)
Replaces a range of chars by a character.
Definition: BasicString.hxx:704
SelfType & Assign(const_iterator first, const_iterator last)
Copies the sequence of characters in the range [first,last), in the same order.
Definition: BasicString.hxx:388
const_iterator Begin() const
Returns the begin iterator of this string.
Definition: BasicString.hxx:862
const_reference operator[](size_type offset) const
Returns a const reference to the character at position offset .
Definition: BasicString.hxx:1023
size_type FindLastNotOf(const SelfType &chars, size_type offset=NPos) const
Finds the last occurence of any character which is not in chars .
Definition: BasicString.hxx:1314
const_iterator ConstBegin() const
Returns the begin iterator of this const string.
Definition: BasicString.hxx:911
typename BaseString::iterator iterator
The iterator type of this type.
Definition: BasicString.hxx:49
BasicString(const CharType *pChars, const Allocator &alloc)
This constructor copies the as argument passed C-string.
Definition: BasicString.hxx:126
SelfType & Assign(const SelfType &arg, size_type offset, size_type count=NPos)
This operation copies the as argument passed string partially.
Definition: BasicString.hxx:326
SelfType & operator+=(std::initializer_list< CharType > right)
This assignment operator appends each of the characters in the right-hand-side operand to this string...
Definition: BasicString.hxx:260
result_type operator()(const argument_type &key) const
This functor operator returns the hash value of the as argument passed string.
Definition: BasicString.hxx:1964
std::basic_string< CharType, std::char_traits< CharType >, Allocator > BaseString
The type of the basic std string.
Definition: BasicString.hxx:38
BasicString(const BaseString &arg)
This copy constructor copies the as argument passed std::string to this string.
Definition: BasicString.hxx:188
int Compare(const CharType *pOther) const
Compares this string to the pOther string lexicographical.
Definition: BasicString.hxx:1399
SelfType & Assign(BaseString &&arg)
This operation moves the argument to this string.
Definition: BasicString.hxx:344
BasicString(const CharType *pChars, size_type count)
This constructor copies the as argument passed C-string.
Definition: BasicString.hxx:102
typename BaseString::difference_type difference_type
The difference type of this type.
Definition: BasicString.hxx:44
SelfType & Replace(const_iterator first, const_iterator last, const SelfType &arg)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:715
SelfType & Append(iterator first, iterator last)
Appends the sequence of characters in the range [first,last), in the same order.
Definition: BasicString.hxx:462
SelfType & Insert(size_type offset, const SelfType &arg, size_type argOffset, size_type count=NPos)
This operation inserts the as argument passed string partially.
Definition: BasicString.hxx:513
typename BaseString::size_type size_type
The size type of this type.
Definition: BasicString.hxx:43
SelfType & Assign(const CharType *pChars, size_type count)
This operation copies the as argument passed C-string partially.
Definition: BasicString.hxx:353
void PopBack()
Removes the character at the end of this string.
Definition: BasicString.hxx:952
BasicString(const CharType *pChars)
This constructor copies the as argument passed C-string.
Definition: BasicString.hxx:118
iterator Insert(const_iterator where, CharType c)
Inserts character c at position where .
Definition: BasicString.hxx:555
iterator Insert(const_iterator where, std::initializer_list< CharType > arg)
This operation inserts each of the characters in the argument to this string, in the same order...
Definition: BasicString.hxx:492
SelfType & Replace(size_type offset, size_type length, const CharType *pChars)
Replaces a range of chars.
Definition: BasicString.hxx:692
SelfType & Assign(const CharType *pChars)
This operation copies the as argument passed C-string.
Definition: BasicString.hxx:361
SelfType & operator=(std::initializer_list< CharType > right)
This assignment operator copies each of the characters in the right-hand-side operand to this string...
Definition: BasicString.hxx:227
const_reference At(size_type offset) const
Returns a const reference to the character at position offset .
Definition: BasicString.hxx:1005
SelfType & Assign(size_type count, CharType c)
Fills this string with count consecutive copies of character c .
Definition: BasicString.hxx:370
size_type FindFirstNotOf(const SelfType &chars, size_type offset=0) const
Finds the first occurence of any character which is not in chars .
Definition: BasicString.hxx:1276
reference Front()
Returns a reference to the first character in the string.
Definition: BasicString.hxx:963
bool operator<=(const BasicString< CharType, Alloc > &left, const BasicString< CharType, Alloc > &right)
Compares the left string to the right string.
Definition: BasicString.hxx:1871
std::allocator< char > Allocator
The characters allocator type.
Definition: BasicString.hxx:34
const_reverse_iterator ConstReverseBegin() const
Returns the begin iterator of this const string for reverse iterating.
Definition: BasicString.hxx:925
BasicString(SelfType &&arg, const Allocator &alloc)
This move constructor moves the as argument passed string to this string.
Definition: BasicString.hxx:155
BasicString(const SelfType &arg, size_type offset, size_type count=NPos)
This constructor copies the as argument passed string partially.
Definition: BasicString.hxx:84