PLCnext API Documentation  21.0.0.35466
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  typedef Alloc Allocator;
35  typedef C CharType;
37  typedef std::basic_string<CharType, std::char_traits<CharType>, Allocator> BaseString;
38 
39 public: // policy typedefs
40  typedef Allocator allocator_type;
41  typedef CharType value_type;
42  typedef typename BaseString::size_type size_type;
43  typedef typename BaseString::difference_type difference_type;
44  typedef typename BaseString::reference reference;
45  typedef typename BaseString::const_reference const_reference;
46  typedef typename Allocator::pointer pointer;
47  typedef typename Allocator::const_pointer const_pointer;
48  typedef typename BaseString::iterator iterator;
49  typedef typename BaseString::const_iterator const_iterator;
50  typedef typename BaseString::reverse_iterator reverse_iterator;
51  typedef typename BaseString::const_reverse_iterator const_reverse_iterator;
52 
53 private: // usings
55 
56 public: // construction/destruction
59  : baseString()
60  {
61  }
62 
65  BasicString(const SelfType& arg)
66  : baseString(arg.baseString)
67  {
68  }
69 
73  BasicString(const SelfType& arg, const Allocator& alloc)
74  : baseString(arg.baseString, alloc)
75  {
76  }
77 
80  explicit BasicString(const Allocator& alloc)
81  : baseString(alloc)
82  {
83  }
84 
89  BasicString(const SelfType& arg, size_type offset, size_type count = NPos)
90  : baseString(arg.baseString, offset, count)
91  {
92  }
93 
99  BasicString(const SelfType& arg, size_type offset, size_type count, const Allocator& alloc)
100  : baseString(arg.baseString, offset, count, alloc)
101  {
102  }
103 
107  BasicString(const CharType* pChars, size_type count)
108  : baseString(pChars, count)
109  {
110  }
111 
116  BasicString(const CharType* pChars, size_type count, const Allocator& alloc)
117  : baseString(pChars, count, alloc)
118  {
119  }
120 
123  BasicString(const CharType* pChars)
124  : baseString(pChars)
125  {
126  }
127 
131  BasicString(const CharType* pChars, const Allocator& alloc)
132  : baseString(pChars, alloc)
133  {
134  }
135 
139  BasicString(size_type count, CharType c)
140  : baseString(count, c)
141  {
142  }
143 
148  BasicString(size_type count, CharType c, const Allocator& alloc)
149  : baseString(count, c, alloc)
150  {
151  }
152 
155  BasicString(SelfType&& arg)
156  : baseString(arg.baseString)
157  {
158  }
159 
163  BasicString(SelfType&& arg, const Allocator& alloc)
164  : baseString(arg.baseString, alloc)
165  {
166  }
167 
171  BasicString(std::initializer_list<CharType> arg, const Allocator& alloc = Allocator())
172  : baseString(arg, alloc)
173  {
174  }
175 
180  BasicString(iterator first, iterator last, const Allocator& alloc = Allocator())
181  : baseString(first, last, alloc)
182  {
183  }
184 
189  BasicString(const_iterator first, const_iterator last, const Allocator& alloc = Allocator())
190  : baseString(first, last, alloc)
191  {
192  }
193 
196  BasicString(const BaseString& arg)
197  : baseString(arg)
198  {
199  }
200 
203  BasicString(BaseString&& arg)
204  : baseString(arg)
205  {
206  }
207 
210  {
211  }
212 
213 public: // static fields
218  static const size_type NPos = size_type(-1);
222  static const SelfType Empty;
226  static const SelfType NewLine;
227 
228 public: // assignment operator
232  SelfType& operator=(SelfType&& right)
233  {
234  this->baseString = right.baseString;
235  return (*this);
236  }
237 
241  SelfType& operator=(std::initializer_list<CharType> right)
242  {
243  this->baseString = right;
244  return (*this);
245  }
246 
250  SelfType& operator=(const SelfType& right)
251  {
252  this->baseString = right.baseString;
253  return (*this);
254  }
255 
259  SelfType& operator=(const CharType* right)
260  {
261  this->baseString = right;
262  return (*this);
263  }
264 
268  SelfType& operator=(CharType c)
269  {
270  this->baseString = c;
271  return (*this);
272  }
273 
274 public: // append operator
278  SelfType& operator+=(std::initializer_list<CharType> right)
279  {
280  this->baseString += right;
281  return (*this);
282  }
283 
287  SelfType& operator+=(const SelfType& right)
288  {
289  this->baseString += right.baseString;
290  return (*this);
291  }
292 
296  SelfType& operator+=(const CharType* right)
297  {
298  this->baseString += right;
299  return (*this);
300  }
301 
305  SelfType& operator+=(CharType c)
306  {
307  this->baseString += c;
308  return (*this);
309  }
310 
311 public: // assign operations
312 
316  SelfType& Assign(SelfType&& arg)
317  {
318  this->baseString = arg.baseString;
319  return *this;
320  }
321 
325  SelfType& Assign(std::initializer_list<CharType> arg)
326  {
327  this->baseString.assign(arg);
328  return *this;
329  }
330 
334  SelfType& Assign(const SelfType& arg)
335  {
336  this->baseString.assign(arg.baseString);
337  return *this;
338  }
339 
344  SelfType& Assign(const SelfType& arg, size_type offset, size_type count = NPos)
345  {
346  this->baseString.assign(arg.baseString, offset, count);
347  return *this;
348  }
349 
353  SelfType& Assign(const BaseString& arg)
354  {
355  this->baseString.assign(arg);
356  return *this;
357  }
358 
362  SelfType& Assign(BaseString&& arg)
363  {
364  this->baseString.assign(arg);
365  return *this;
366  }
367 
371  SelfType& Assign(const CharType* pChars, size_type count)
372  {
373  this->baseString.assign(pChars, count);
374  return *this;
375  }
376 
379  SelfType& Assign(const CharType* pChars)
380  {
381  this->baseString.assign(pChars);
382  return *this;
383  }
384 
388  SelfType& Assign(size_type count, CharType c)
389  {
390  this->baseString.assign(count, c);
391  return *this;
392  }
393 
397  SelfType& Assign(iterator first, iterator last)
398  {
399  this->baseString.assign(first, last);
400  return *this;
401  }
402 
406  SelfType& Assign(const_iterator first, const_iterator last)
407  {
408  this->baseString.assign(first, last);
409  return *this;
410  }
411 
415  SelfType& Assign(const_pointer first, const_pointer last)
416  {
417  this->baseString.assign(first, last);
418  return *this;
419  }
420 
421 public: // append operations
422 
426  SelfType& Append(std::initializer_list<CharType> arg)
427  {
428  this->baseString.append(arg);
429  return *this;
430  }
431 
435  SelfType& Append(const SelfType& arg)
436  {
437  this->baseString.append(arg.baseString);
438  return *this;
439  }
440 
445  SelfType& Append(const SelfType& arg, size_type offset, size_type count = NPos)
446  {
447  this->baseString.append(arg.baseString, offset, count);
448  return *this;
449  }
450 
454  SelfType& Append(const CharType* pChars, size_type count)
455  {
456  this->baseString.append(pChars, count);
457  return *this;
458  }
459 
462  SelfType& Append(const CharType* pChars)
463  {
464  this->baseString.append(pChars);
465  return *this;
466  }
467 
471  SelfType& Append(size_type count, CharType c)
472  {
473  this->baseString.append(count, c);
474  return *this;
475  }
476 
480  SelfType& Append(iterator first, iterator last)
481  {
482  this->baseString.append(first, last);
483  return *this;
484  }
485 
489  SelfType& Append(const_iterator first, const_iterator last)
490  {
491  this->baseString.append(first, last);
492  return *this;
493  }
494 
498  SelfType& Append(const_pointer first, const_pointer last)
499  {
500  this->baseString.append(first, last);
501  return *this;
502  }
503 
504 public: // insert operations
505 
510  iterator Insert(const_iterator where, std::initializer_list<CharType> arg)
511  {
512  return this->baseString.insert(where, arg);
513  }
514 
519  SelfType& Insert(size_type offset, const SelfType& arg)
520  {
521  this->baseString.insert(offset, arg.baseString);
522  return *this;
523  }
524 
531  SelfType& Insert(size_type offset, const SelfType& arg, size_type argOffset, size_type count = NPos)
532  {
533  this->baseString.insert(offset, arg.baseString, argOffset, count);
534  return *this;
535  }
536 
542  SelfType& Insert(size_type offset, const CharType* pChars, size_type count)
543  {
544  this->baseString.insert(offset, pChars, count);
545  return *this;
546  }
547 
552  SelfType& Insert(size_type offset, const CharType* pChars)
553  {
554  this->baseString.insert(offset, pChars);
555  return *this;
556  }
557 
563  SelfType& Insert(size_type offset, size_type count, CharType c)
564  {
565  this->baseString.insert(offset, count, c);
566  return *this;
567  }
568 
569  ARP_DEPRECATED("Do not use this operation, is is not part of the C++ standard and will be removed in future.")
571  iterator Insert(const_iterator where)
572  {
573  return this->baseString.insert(where);
574  }
575 
580  iterator Insert(const_iterator where, CharType c)
581  {
582  return this->baseString.insert(where, c);
583  }
584 
590  iterator Insert(const_iterator where, size_type count, CharType c)
591  {
592  return this->baseString.insert(where, count, c);
593  }
594 
600  iterator Insert(const_iterator where, iterator first, iterator last)
601  {
602  return this->baseString.insert(where, first, last);
603  }
604 
610  iterator Insert(const_iterator where, const_iterator first, const_iterator last)
611  {
612  return this->baseString.insert(where, first, last);
613  }
614 
620  iterator Insert(const_iterator where, const_pointer first, const_pointer last)
621  {
622  return this->baseString.insert(where, first, last);
623  }
624 
625 public: // erase operations
626 
630  SelfType& Erase(size_type offset = 0)
631  {
632  this->baseString.erase(offset);
633  return (*this);
634  }
635 
640  SelfType& Erase(size_type offset, size_type count)
641  {
642  this->baseString.erase(offset, count);
643  return (*this);
644  }
645 
649  iterator Erase(const_iterator where)
650  {
651  return this->baseString.erase(where);
652  }
653 
658  iterator Erase(const_iterator first, const_iterator last)
659  {
660  return this->baseString.erase(first, last);
661  }
662 
663 public: // replace operation
664 
670  SelfType& Replace(const_iterator first, const_iterator last, std::initializer_list<CharType> chars)
671  {
672  this->baseString.replace(first, last, chars);
673  return *this;
674  }
675 
681  SelfType& Replace(size_type offset, size_type length, const SelfType& arg)
682  {
683  this->baseString.replace(offset, length, arg.baseString);
684  return (*this);
685  }
686 
694  SelfType& Replace(size_type offset, size_type length, const SelfType& arg, size_type offsetArg, size_type count = NPos)
695  {
696  this->baseString.replace(offset, length, arg.baseString, offsetArg, count);
697  return (*this);
698  }
699 
706  SelfType& Replace(size_type offset, size_type length, const CharType* pChars, size_type count)
707  {
708  this->baseString.replace(offset, length, pChars, offset, count);
709  return (*this);
710  }
711 
717  SelfType& Replace(size_type offset, size_type length, const CharType* pChars)
718  {
719  this->baseString.replace(offset, length, pChars);
720  return (*this);
721  }
722 
729  SelfType& Replace(size_type offset, size_type length, size_type count, CharType c)
730  {
731  this->baseString.replace(offset, length, count, c);
732  return (*this);
733  }
734 
740  SelfType& Replace(const_iterator first, const_iterator last, const SelfType& arg)
741  {
742  this->baseString.replace(first, last, arg.baseString);
743  return (*this);
744  }
745 
752  SelfType& Replace(const_iterator first, const_iterator last, const CharType* pChars, size_type count)
753  {
754  this->baseString.replace(first, last, pChars, count);
755  return (*this);
756  }
757 
763  SelfType& Replace(const_iterator first, const_iterator last, const CharType* pChars)
764  {
765  this->baseString.replace(first, last, pChars);
766  return (*this);
767  }
768 
775  SelfType& Replace(const_iterator first, const_iterator last, size_type count, CharType c)
776  {
777  this->baseString.replace(first, last, count, c);
778  return (*this);
779  }
780 
787  SelfType& Replace(const_iterator first, const_iterator last, iterator first2, iterator last2)
788  {
789  this->baseString.replace(first, last, first2, last2);
790  return (*this);
791  }
792 
799  SelfType& Replace(const_iterator first, const_iterator last, const_iterator first2, const_iterator last2)
800  {
801  this->baseString.replace(first, last, first2, last2);
802  return (*this);
803  }
804 
811  SelfType& Replace(const_iterator first, const_iterator last, const_pointer first2, const_pointer last2)
812  {
813  this->baseString.replace(first, last, first2, last2);
814  return (*this);
815  }
816 
823  SelfType& Replace(const_iterator first, const_iterator last, pointer first2, pointer last2)
824  {
825  this->baseString.replace(first, last, first2, last2);
826  return (*this);
827  }
828 
829 public: // replace_all operations
830 
836  SelfType& ReplaceAll(const SelfType& pattern, const SelfType& replacement)
837  {
838  boost::replace_all(this->baseString, pattern.baseString, replacement.baseString);
839  return (*this);
840  }
841 
842 public: // support of range based for loops
843 
847  iterator begin()
848  {
849  return this->baseString.begin();
850  }
851 
855  const_iterator begin() const
856  {
857  return this->baseString.begin();
858  }
859 
863  iterator end()
864  {
865  return this->baseString.end();
866  }
867 
871  const_iterator end() const
872  {
873  return this->baseString.end();
874  }
875 
876 public: // container operations
877 
880  iterator Begin()
881  {
882  return this->baseString.begin();
883  }
884 
887  const_iterator Begin() const
888  {
889  return this->baseString.begin();
890  }
891 
894  iterator End()
895  {
896  return this->baseString.end();
897  }
898 
901  const_iterator End() const
902  {
903  return this->baseString.end();
904  }
905 
908  reverse_iterator ReverseBegin()
909  {
910  return this->baseString.rbegin();
911  }
912 
915  const_reverse_iterator ReverseBegin() const
916  {
917  return this->baseString.rbegin();
918  }
919 
922  reverse_iterator ReverseEnd()
923  {
924  return this->baseString.rend();
925  }
926 
929  const_reverse_iterator ReverseEnd() const
930  {
931  return this->baseString.rend();
932  }
933 
936  const_iterator ConstBegin() const
937  {
938  return this->baseString.cbegin();
939  }
940 
943  const_iterator ConstEnd() const
944  {
945  return this->baseString.cend();
946  }
947 
950  const_reverse_iterator ConstReverseBegin() const
951  {
952  return this->baseString.crbegin();
953  }
954 
957  const_reverse_iterator ConstReverseEnd() const
958  {
959  return this->baseString.crend();
960  }
961 
963  void ShrinkToFit()
964  {
965  this->baseString.shrink_to_fit();
966  }
967 
970  void PushBack(CharType c)
971  {
972  this->baseString.push_back(c);
973  }
974 
977  void PopBack()
978  {
979  if(!this->IsEmpty())
980  {
981  this->baseString.pop_back();
982  }
983  }
984 
988  reference Front()
989  {
990  return this->baseString.front();
991  }
992 
996  const_reference Front() const
997  {
998  return this->baseString.front();
999  }
1000 
1004  reference Back()
1005  {
1006  return this->baseString.back();
1007  }
1008 
1012  const_reference Back() const
1013  {
1014  return this->baseString.back();
1015  }
1016 
1021  reference At(size_type offset)
1022  {
1023  return this->baseString.at(offset);
1024  }
1025 
1030  const_reference At(size_type offset) const
1031  {
1032  return this->baseString.at(offset);
1033  }
1034 
1039  reference operator[](size_type offset)
1040  {
1041  return this->baseString[offset];
1042  }
1043 
1048  const_reference operator[](size_type offset) const
1049  {
1050  return this->baseString[offset];
1051  }
1052 
1053 public: // Size/Length operations
1054 
1062  size_type Length() const
1063  {
1064  return this->baseString.length();
1065  }
1066 
1074  size_type Size() const
1075  {
1076  return this->baseString.size();
1077  }
1078 
1080  size_type MaxSize() const
1081  {
1082  return this->baseString.max_size();
1083  }
1084 
1092  size_type Capacity() const
1093  {
1094  return this->baseString.capacity();
1095  }
1096 
1099  bool IsEmpty() const
1100  {
1101  return this->baseString.empty();
1102  }
1103 
1110  void Resize(size_type newSize)
1111  {
1112  this->baseString.resize(newSize);
1113  }
1114 
1122  void Resize(size_type newSize, CharType c)
1123  {
1124  this->baseString.resize(newSize, c);
1125  }
1126 
1134  void Reserve(size_type newCapacity = 0)
1135  {
1136  this->baseString.reserve(newCapacity);
1137  }
1138 
1140  void Clear()
1141  {
1142  this->baseString.clear();
1143  }
1144 
1145 public: // Find operations
1146 
1151  size_type Find(const SelfType& pattern, size_type offset = 0) const
1152  {
1153  return this->baseString.find(pattern.baseString, offset);
1154  }
1155 
1161  size_type Find(const CharType* pChars, size_type offset, size_type count) const
1162  {
1163  return this->baseString.find(pChars, offset, count);
1164  }
1165 
1170  size_type Find(const CharType* pChars, size_type offset = 0) const
1171  {
1172  return this->baseString.find(pChars, offset);
1173  }
1174 
1179  size_type Find(CharType c, size_type offset = 0) const
1180  {
1181  return this->baseString.find(c, offset);
1182  }
1183 
1188  size_type ReverseFind(const SelfType& pattern, size_type offset = NPos) const
1189  {
1190  return this->baseString.rfind(pattern.baseString, offset);
1191  }
1192 
1198  size_type ReverseFind(const CharType* pChars, size_type offset, size_type count) const
1199  {
1200  return this->baseString.rfind(pChars, offset, count);
1201  }
1202 
1207  size_type ReverseFind(const CharType* pChars, size_type offset = NPos) const
1208  {
1209  return this->baseString.rfind(pChars, offset);
1210  }
1211 
1216  size_type ReverseFind(CharType c, size_type offset = NPos) const
1217  {
1218  return this->baseString.rfind(c, offset);
1219  }
1220 
1225  size_type FindFirstOf(const SelfType& chars, size_type offset = 0) const
1226  {
1227  return this->baseString.find_first_of(chars.baseString, offset);
1228  }
1229 
1235  size_type FindFirstOf(const CharType* pChars, size_type offset, size_type count) const
1236  {
1237  return this->baseString.find_first_of(pChars, offset, count);
1238  }
1239 
1244  size_type FindFirstOf(const CharType* pChars, size_type offset = 0) const
1245  {
1246  return this->baseString.find_first_of(pChars, offset);
1247  }
1248 
1254  size_type FindFirstOf(CharType c, size_type offset = 0) const
1255  {
1256  return this->baseString.find_first_of(c, offset);
1257  }
1258 
1263  size_type FindLastOf(const SelfType& chars, size_type offset = NPos) const
1264  {
1265  return this->baseString.find_last_of(chars.baseString, offset);
1266  }
1267 
1273  size_type FindLastOf(const CharType* pChars, size_type offset, size_type count) const
1274  {
1275  return this->baseString.find_last_of(pChars, offset, count);
1276  }
1277 
1282  size_type FindLastOf(const CharType* pChars, size_type offset = NPos) const
1283  {
1284  return this->baseString.find_last_of(pChars, offset);
1285  }
1286 
1292  size_type FindLastOf(CharType c, size_type offset = NPos) const
1293  {
1294  return this->baseString.find_last_of(c, offset);
1295  }
1296 
1301  size_type FindFirstNotOf(const SelfType& chars, size_type offset = 0) const
1302  {
1303  return this->baseString.find_first_not_of(chars.baseString, offset);
1304  }
1305 
1311  size_type FindFirstNotOf(const CharType* pChars, size_type offset, size_type count) const
1312  {
1313  return this->baseString.find_first_not_of(pChars, offset, count);
1314  }
1315 
1320  size_type FindFirstNotOf(const CharType *pChars, size_type offset = 0) const
1321  {
1322  return this->baseString.find_first_not_of(pChars, offset);
1323  }
1324 
1330  size_type FindFirstNotOf(CharType c, size_type offset = 0) const
1331  {
1332  return this->baseString.find_first_not_of(c, offset);
1333  }
1334 
1339  size_type FindLastNotOf(const SelfType& chars, size_type offset = NPos) const
1340  {
1341  return this->baseString.find_last_not_of(chars.baseString, offset);
1342  }
1343 
1349  size_type FindLastNotOf(const CharType *pChars, size_type offset, size_type count) const
1350  {
1351  return this->baseString.find_last_not_of(pChars, offset, count);
1352  }
1353 
1358  size_type FindLastNotOf(const CharType *pChars, size_type offset = NPos) const
1359  {
1360  return this->baseString.find_last_not_of(pChars, offset);
1361  }
1362 
1368  size_type FindLastNotOf(CharType c, size_type offset = NPos) const
1369  {
1370  return this->baseString.find_last_not_of(c, offset);
1371  }
1372 
1373 public: // Compare operations
1374 
1382  int Compare(const SelfType& other) const
1383  {
1384  return this->baseString.compare(other.baseString);
1385  }
1386 
1396  int Compare(size_type offset, size_type count, const SelfType& other) const
1397  {
1398  return this->baseString.compare(offset, count, other.baseString);
1399  }
1400 
1412  int Compare(size_type offset, size_type count, const SelfType& other, size_type offsetOther, size_type countOther = NPos) const
1413  {
1414  return this->baseString.compare(offset, count, other.baseString, offsetOther, countOther);
1415  }
1416 
1424  int Compare(const CharType *pOther) const
1425  {
1426  return this->baseString.compare(pOther);
1427  }
1428 
1438  int Compare(size_type offset, size_type count, const CharType *pOther) const
1439  {
1440  return this->baseString.compare(offset, count, pOther);
1441  }
1442 
1453  int Compare(size_type offset, size_type count, const CharType *pOther, size_type countOther) const
1454  {
1455  return this->baseString.compare(offset, count, pOther, countOther);
1456  }
1457 
1458 public: // misc operations (none std)
1459 
1463  bool StartWith(const CharType *pChars)const
1464  {
1465  return this->Find(pChars) == 0;
1466  }
1467 
1471  bool StartWith(const SelfType& pattern)const
1472  {
1473  return this->Find(pattern) == 0;
1474  }
1475 
1476 public: // Format operations
1481  template<typename... Args>
1482  static SelfType Format(const SelfType& format, const Args& ... args)
1483  {
1484  return Format(format.CStr(), args...);
1485  }
1486 
1491  template<typename... Args>
1492  static SelfType Format(const char* format, const Args& ... args)
1493  {
1494  return BasicFormatterType::FormatCommon(&BasicStringFormatExceptionHandler::Invoke, format, args...);
1495  }
1496 
1497 public: // Misc operations
1500  const BaseString& GetBaseString()const
1501  {
1502  return this->baseString;
1503  }
1504 
1507  const CharType* CStr() const
1508  {
1509  return this->baseString.c_str();
1510  }
1511 
1514  operator const CharType*() const
1515  {
1516  return this->baseString.data();
1517  }
1518 
1521  operator const BaseString& () const
1522  {
1523  return this->baseString;
1524  }
1525 
1530  SelfType Substr(size_type offset = 0, size_type count = NPos) const
1531  {
1532  return SelfType(this->baseString.substr(offset, count));
1533  }
1534 
1537  Allocator GetAllocator() const
1538  {
1539  return this->baseString.get_allocator();
1540  }
1541 
1544  void Swap(SelfType& other)
1545  {
1546  this->baseString.swap(other.baseString);
1547  }
1548 
1549  // warning 4996 occurs, to avoid use _SCL_SECURE_NO_WARNINGS
1550  //size_type Copy(CharType* pChars, size_type count, size_type offset = 0) const
1551  //{
1552  // return this->baseString.copy(pChars, count, offset);
1553  //}
1554 
1555 private: // fields
1556  BaseString baseString;
1557 };
1558 
1560 // initializing of static fields
1561 template <class CharType, class Alloc>
1563 
1564 template <class CharType, class Alloc>
1565 const BasicString<CharType, Alloc> BasicString<CharType, Alloc>::NewLine((CharType)'\n', (CharType)'\r');
1566 
1568 // inline global operators and functions of class BasicString<CharType, Alloc>
1569 
1573 template<class CharType, class Alloc>
1575 {
1576  left.swap(right);
1577 }
1578 
1583 template<class CharType, class Alloc>
1584 inline std::ostream& operator<<(std::ostream& os, const BasicString<CharType, Alloc>& right)
1585 {
1586  os << right.GetBaseString();
1587  return os;
1588 }
1589 
1594 template<class CharType, class Alloc>
1595 inline std::istream& operator>>(std::istream& is, BasicString<CharType, Alloc>& right)
1596 {
1597  std::basic_string<CharType, std::char_traits<CharType>, Alloc> baseString;
1598  is >> baseString;
1599  right.Assign(baseString);
1600  return is;
1601 }
1602 
1607 template<class CharType, class Alloc>
1609  const BasicString<CharType, Alloc>& left,
1610  const BasicString<CharType, Alloc>& right)
1611 {
1612  return left.GetBaseString() + right.GetBaseString();
1613 }
1614 
1619 template<class CharType, class Alloc>
1621  const CharType* left,
1622  const BasicString<CharType, Alloc>& right)
1623 {
1624  return left + right.GetBaseString();
1625 }
1626 
1631 template<class CharType, class Alloc>
1633  const CharType left,
1634  const BasicString<CharType, Alloc>& right)
1635 {
1636  return left + right.GetBaseString();
1637 }
1638 
1643 template<class CharType, class Alloc>
1645  const BasicString<CharType, Alloc>& left,
1646  const CharType* right)
1647 {
1648  return left.GetBaseString() + right;
1649 }
1650 
1655 template<class CharType, class Alloc>
1657  const BasicString<CharType, Alloc>& left,
1658  const CharType right)
1659 {
1660  return left.GetBaseString() + right;
1661 }
1662 
1667 template<class CharType, class Alloc>
1669  const BasicString<CharType, Alloc>& left,
1671 {
1672  return left.GetBaseString() + right.GetBaseString();
1673 }
1674 
1679 template<class CharType, class Alloc>
1682  const BasicString<CharType, Alloc>& right)
1683 {
1684  return (std::move(left.Append(right)));
1685 }
1686 
1691 template<class CharType, class Alloc>
1695 {
1696  return left.GetBaseString() + right.GetBaseString();
1697 }
1698 
1703 template<class CharType, class Alloc>
1705  const CharType* left,
1707 {
1708  return left + right.GetBaseString();
1709 }
1710 
1715 template<class CharType, class Alloc>
1717  const CharType left,
1719 {
1720  return left + right.GetBaseString();
1721 }
1722 
1727 template<class CharType, class Alloc>
1730  const CharType* right)
1731 {
1732  return left.GetBaseString() + right;
1733 }
1734 
1739 template<class CharType, class Alloc>
1742  const CharType right)
1743 {
1744  return left.GetBaseString() + right;
1745 }
1746 
1751 template<class CharType, class Alloc>
1752 inline bool operator==(
1753  const BasicString<CharType, Alloc>& left,
1754  const BasicString<CharType, Alloc>& right)
1755 {
1756  return left.GetBaseString() == right.GetBaseString();
1757 }
1758 
1763 template<class CharType, class Alloc>
1764 inline bool operator==(
1765  const CharType* left,
1766  const BasicString<CharType, Alloc>& right)
1767 {
1768  return left == right.GetBaseString();
1769 }
1770 
1775 template<class CharType, class Alloc>
1776 inline bool operator==(
1777  const BasicString<CharType, Alloc>& left,
1778  const CharType* right)
1779 {
1780  return left.GetBaseString() == right;
1781 }
1782 
1787 template<class CharType, class Alloc>
1788 inline bool operator!=(
1789  const BasicString<CharType, Alloc>& left,
1790  const BasicString<CharType, Alloc>& right)
1791 {
1792  return (!(left == right));
1793 }
1794 
1799 template<class CharType, class Alloc>
1800 inline bool operator!=(
1801  const CharType *left,
1802  const BasicString<CharType, Alloc>& right)
1803 {
1804  return (!(left == right));
1805 }
1806 
1811 template<class CharType, class Alloc>
1812 inline bool operator!=(
1813  const BasicString<CharType, Alloc>& left,
1814  const CharType* right)
1815 {
1816  return (!(left == right));
1817 }
1818 
1823 template<class CharType, class Alloc>
1824 inline bool operator<(
1825  const BasicString<CharType, Alloc>& left,
1826  const BasicString<CharType, Alloc>& right)
1827 {
1828  return left.GetBaseString() < right.GetBaseString();
1829 }
1830 
1835 template<class CharType, class Alloc>
1836 inline bool operator<(
1837  const CharType* left,
1838  const BasicString<CharType, Alloc>& right)
1839 {
1840  return left < right.GetBaseString();
1841 }
1842 
1847 template<class CharType, class Alloc>
1848 inline bool operator<(
1849  const BasicString<CharType, Alloc>& left,
1850  const CharType* right)
1851 {
1852  return left.GetBaseString() < right;
1853 }
1854 
1859 template<class CharType, class Alloc>
1860 inline bool operator>(
1861  const BasicString<CharType, Alloc>& left,
1862  const BasicString<CharType, Alloc>& right)
1863 {
1864  return (right < left);
1865 }
1866 
1871 template<class CharType, class Alloc>
1872 inline bool operator>(
1873  const CharType* left,
1874  const BasicString<CharType, Alloc>& right)
1875 {
1876  return (right < left);
1877 }
1878 
1883 template<class CharType, class Alloc>
1884 inline bool operator>(
1885  const BasicString<CharType, Alloc>& left,
1886  const CharType* right)
1887 {
1888  return (right < left);
1889 }
1890 
1895 template<class CharType, class Alloc>
1896 inline bool operator<=(
1897  const BasicString<CharType, Alloc>& left,
1898  const BasicString<CharType, Alloc>& right)
1899 {
1900  return (!(right < left));
1901 }
1902 
1907 template<class CharType, class Alloc>
1908 inline bool operator<=(
1909  const CharType* left,
1910  const BasicString<CharType, Alloc>& right)
1911 {
1912  return (!(right < left));
1913 }
1914 
1919 template<class CharType, class Alloc>
1920 inline bool operator<=(
1921  const BasicString<CharType, Alloc>& left,
1922  const CharType* right)
1923 {
1924  return (!(right < left));
1925 }
1926 
1931 template<class CharType, class Alloc>
1932 inline bool operator>=(
1933  const BasicString<CharType, Alloc>& left,
1934  const BasicString<CharType, Alloc>& right)
1935 {
1936  return (!(left < right));
1937 }
1938 
1943 template<class CharType, class Alloc>
1944 inline bool operator>=(
1945  const CharType* left,
1946  const BasicString<CharType, Alloc>& right)
1947 {
1948  return (!(left < right));
1949 }
1950 
1955 template<class CharType, class Alloc>
1956 inline bool operator>=(
1957  const BasicString<CharType, Alloc>& left,
1958  const CharType* right)
1959 {
1960  return (!(left < right));
1961 }
1962 
1963 } // end of namesapce Arp
1964 
1966 // standard template specializations of class BasicString<C,Alloc>
1967 namespace std
1968 {
1969 
1973 template<class C, class Alloc>
1974 struct hash<Arp::BasicString<C, Alloc>>
1975 {
1976 private:
1978 
1979 public:
1983  typedef size_t result_type;
1984 
1985 public:
1989  result_type operator()(const argument_type& key) const
1990  {
1991  return std::hash<BaseString>()(key.GetBaseString());
1992  }
1993 };
1994 
1996 
1997 } // end of namespace std
const_reverse_iterator ReverseBegin() const
Returns the begin iterator of this string for reverse iterating.
Definition: BasicString.hxx:915
BasicString(const CharType *pChars, size_type count, const Allocator &alloc)
This constructor copies the as argument passed C-string.
Definition: BasicString.hxx:116
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:1608
BasicString(const SelfType &arg, const Allocator &alloc)
This constructor copies the as argument passed string deeply.
Definition: BasicString.hxx:73
size_type FindLastOf(CharType c, size_type offset=NPos) const
Finds the last occurence of character c .
Definition: BasicString.hxx:1292
size_type Size() const
Returns the number of char elements in this string.
Definition: BasicString.hxx:1074
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:1492
SelfType & operator=(SelfType &&right)
This move assignment operator moves the right-hand-side operand to this string.
Definition: BasicString.hxx:232
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:218
SelfType & Assign(const SelfType &arg)
This operation copies the the argument to this string.
Definition: BasicString.hxx:334
std::istream & operator>>(std::istream &is, BasicString< CharType, Alloc > &right)
Streams the instream is into the right string.
Definition: BasicString.hxx:1595
BasicString(SelfType &&arg)
This move constructor moves the as argument passed string to this string.
Definition: BasicString.hxx:155
iterator Begin()
Returns the begin iterator of this string.
Definition: BasicString.hxx:880
SelfType & Replace(const_iterator first, const_iterator last, const CharType *pChars, size_type count)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:752
BaseString::iterator iterator
The iterator type of this type.
Definition: BasicString.hxx:48
SelfType & Replace(const_iterator first, const_iterator last, const CharType *pChars)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:763
SelfType & operator+=(const CharType *right)
This assignment operator appends the the right-hand-side operand to this string.
Definition: BasicString.hxx:296
SelfType & operator+=(const SelfType &right)
This assignment operator appends the the right-hand-side operand to this string.
Definition: BasicString.hxx:287
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:1368
BaseString::const_reverse_iterator const_reverse_iterator
The const reverse iterator type of this type.
Definition: BasicString.hxx:51
BaseString::size_type size_type
The size type of this type.
Definition: BasicString.hxx:42
SelfType & Replace(const_iterator first, const_iterator last, iterator first2, iterator last2)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:787
size_type Find(const CharType *pChars, size_type offset=0) const
Finds the first substring which equal to pChars .
Definition: BasicString.hxx:1170
static const SelfType NewLine
This static string instance represents the (platform specific) new line string.
Definition: BasicString.hxx:226
SelfType & Replace(const_iterator first, const_iterator last, size_type count, CharType c)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:775
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:1788
SelfType & Insert(size_type offset, const CharType *pChars)
This operation inserts the as argument passed string.
Definition: BasicString.hxx:552
SelfType & Erase(size_type offset, size_type count)
This operation erases chars from this string.
Definition: BasicString.hxx:640
const_reference Back() const
Returns a const reference to the last character in the string.
Definition: BasicString.hxx:1012
SelfType & Append(size_type count, CharType c)
Appends to this string count consecutive copies of character c .
Definition: BasicString.hxx:471
BaseString::const_iterator const_iterator
The const iterator type of this type.
Definition: BasicString.hxx:49
SelfType & Replace(size_type offset, size_type length, const CharType *pChars, size_type count)
Replaces a range of chars.
Definition: BasicString.hxx:706
BaseString::reverse_iterator reverse_iterator
The reverse iterator type of this type.
Definition: BasicString.hxx:50
BasicString(std::initializer_list< CharType > arg, const Allocator &alloc=Allocator())
Copies each of the characters in initList , in the same order.
Definition: BasicString.hxx:171
size_type MaxSize() const
Returns the number maximum size any string might have.
Definition: BasicString.hxx:1080
int Compare(size_type offset, size_type count, const CharType *pOther) const
Compares this string to the pOther string lexicographical.
Definition: BasicString.hxx:1438
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:694
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:1273
SelfType & Assign(SelfType &&arg)
This operation moves the as argument passed string to this string.
Definition: BasicString.hxx:316
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:1412
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:415
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:426
int Compare(size_type offset, size_type count, const SelfType &other) const
Compares this string to the other string lexicographical.
Definition: BasicString.hxx:1396
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:489
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:1004
SelfType & Assign(const BaseString &arg)
This operation copies the argument to this string.
Definition: BasicString.hxx:353
Namespace of the C++ standard library
std::basic_string< CharType, std::char_traits< CharType >, Allocator > BaseString
The type of the basic std string.
Definition: BasicString.hxx:37
SelfType Substr(size_type offset=0, size_type count=NPos) const
Gets a substring of this string.
Definition: BasicString.hxx:1530
CharType value_type
The char type of this type.
Definition: BasicString.hxx:41
size_type ReverseFind(CharType c, size_type offset=NPos) const
Finds the last char which equal to c .
Definition: BasicString.hxx:1216
const_iterator End() const
Returns the end iterator of this string.
Definition: BasicString.hxx:901
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:1235
Definition: BasicFormatter.hxx:18
Allocator::pointer pointer
The pointer type of this type.
Definition: BasicString.hxx:46
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:99
size_type FindFirstOf(const CharType *pChars, size_type offset=0) const
Finds the first occurence of any character in pChars .
Definition: BasicString.hxx:1244
BaseString::reference reference
The reference type of this type.
Definition: BasicString.hxx:44
iterator end()
Returns the end iterator of this string.
Definition: BasicString.hxx:863
bool operator>(const BasicString< CharType, Alloc > &left, const BasicString< CharType, Alloc > &right)
Compares the left string to the right string.
Definition: BasicString.hxx:1860
BaseString::const_reference const_reference
The const reference type of this type.
Definition: BasicString.hxx:45
iterator Insert(const_iterator where, const_iterator first, const_iterator last)
Inserts a range of chars [first;last) at position where .
Definition: BasicString.hxx:610
const_iterator ConstEnd() const
Returns the end iterator of this const string.
Definition: BasicString.hxx:943
bool operator<(const BasicString< CharType, Alloc > &left, const BasicString< CharType, Alloc > &right)
Compares the left string to the right string.
Definition: BasicString.hxx:1824
bool StartWith(const SelfType &pattern) const
Determines if this string starts with the pattern string.
Definition: BasicString.hxx:1471
size_type FindFirstOf(const SelfType &chars, size_type offset=0) const
Finds the first occurence of any character in chars .
Definition: BasicString.hxx:1225
int Compare(const SelfType &other) const
Compares this string to the other string lexicographical.
Definition: BasicString.hxx:1382
size_type FindFirstOf(CharType c, size_type offset=0) const
Finds the first occurence of character c .
Definition: BasicString.hxx:1254
size_t result_type
The result type of this functor class (stl policy type)
Definition: BasicString.hxx:1983
size_type FindLastOf(const SelfType &chars, size_type offset=NPos) const
Finds the last occurence of any character in chars .
Definition: BasicString.hxx:1263
reference At(size_type offset)
Returns a const reference to the character at position offset .
Definition: BasicString.hxx:1021
size_type Find(CharType c, size_type offset=0) const
Finds the first char which equal to c .
Definition: BasicString.hxx:1179
void Reserve(size_type newCapacity=0)
Reserves memory upto the specified newCapacity .
Definition: BasicString.hxx:1134
const CharType * CStr() const
Gets the character data of this string.
Definition: BasicString.hxx:1507
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:498
void Swap(SelfType &other)
Swaps the content of this string with the content of the other string.
Definition: BasicString.hxx:1544
Definition: BasicStringFormatExceptionHandler.hpp:15
const BaseString & GetBaseString() const
Gets the basic std string.
Definition: BasicString.hxx:1500
BaseString::difference_type difference_type
The difference type of this type.
Definition: BasicString.hxx:43
iterator Insert(const_iterator where, const_pointer first, const_pointer last)
Inserts a range of chars [first;last) at position where .
Definition: BasicString.hxx:620
size_type Find(const SelfType &pattern, size_type offset=0) const
Finds the first substring which equal to pattern .
Definition: BasicString.hxx:1151
reverse_iterator ReverseBegin()
Returns the begin iterator of this string for reverse iterating.
Definition: BasicString.hxx:908
SelfType & Erase(size_type offset=0)
This operation erases chars from this string.
Definition: BasicString.hxx:630
~BasicString()
The destructor deallocates all memory of this instance.
Definition: BasicString.hxx:209
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:1358
bool IsEmpty() const
Determines if this string is empty.
Definition: BasicString.hxx:1099
SelfType & operator+=(CharType c)
This assignment operator appends the the right-hand-side operand to this string.
Definition: BasicString.hxx:305
SelfType & Append(const SelfType &arg)
This operation appends the the argument to this string.
Definition: BasicString.hxx:435
void Resize(size_type newSize, CharType c)
Resizes this string to the specified new size.
Definition: BasicString.hxx:1122
iterator Insert(const_iterator where, size_type count, CharType c)
Inserts character c at position where .
Definition: BasicString.hxx:590
static const SelfType Empty
An emtpy static string instance.
Definition: BasicString.hxx:222
SelfType & Replace(const_iterator first, const_iterator last, const_pointer first2, const_pointer last2)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:811
SelfType & operator=(const SelfType &right)
This assignment operator copies the the right-hand-side operand to this string.
Definition: BasicString.hxx:250
void ShrinkToFit()
Reduces the capacity of this string to its size.
Definition: BasicString.hxx:963
iterator Erase(const_iterator first, const_iterator last)
Erases a range of chars [first;last).
Definition: BasicString.hxx:658
BasicString(size_type count, CharType c)
Fills the string with count consecutive copies of character c .
Definition: BasicString.hxx:139
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:1320
Allocator GetAllocator() const
Gets the allocator of this string.
Definition: BasicString.hxx:1537
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:189
reference operator[](size_type offset)
Returns a reference to the character at position offset .
Definition: BasicString.hxx:1039
void PushBack(CharType c)
Appends the character c to this string.
Definition: BasicString.hxx:970
bool StartWith(const CharType *pChars) const
Determines if this string starts with the pChars C-string.
Definition: BasicString.hxx:1463
iterator Erase(const_iterator where)
This operation erases chars from this string.
Definition: BasicString.hxx:649
Alloc Allocator
The characters allocator type.
Definition: BasicString.hxx:34
void Clear()
Clears the content of this string, but does not modify the capacity.
Definition: BasicString.hxx:1140
size_type ReverseFind(const SelfType &pattern, size_type offset=NPos) const
Finds the last substring which equal to pattern .
Definition: BasicString.hxx:1188
iterator End()
Returns the end iterator of this string.
Definition: BasicString.hxx:894
BasicString(size_type count, CharType c, const Allocator &alloc)
Fills the string with count consecutive copies of character c .
Definition: BasicString.hxx:148
size_type Find(const CharType *pChars, size_type offset, size_type count) const
Finds the first substring which equal to pChars .
Definition: BasicString.hxx:1161
size_type ReverseFind(const CharType *pChars, size_type offset=NPos) const
Finds the last substring which equal to pChars .
Definition: BasicString.hxx:1207
size_type Length() const
Returns the number of char elements in this string.
Definition: BasicString.hxx:1062
void Resize(size_type newSize)
Resizes this string to the specified new size.
Definition: BasicString.hxx:1110
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:325
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:1574
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:1330
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:1453
SelfType & ReplaceAll(const SelfType &pattern, const SelfType &replacement)
Replaces a given pattern by a replacement string.
Definition: BasicString.hxx:836
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:1198
SelfType & Append(const SelfType &arg, size_type offset, size_type count=NPos)
This operation appends the as argument passed string partially.
Definition: BasicString.hxx:445
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:1482
BasicString(BaseString &&arg)
This move constructor moves the as argument passed std::string to this string.
Definition: BasicString.hxx:203
size_type FindLastOf(const CharType *pChars, size_type offset=NPos) const
Finds the last occurence of any character in pChars .
Definition: BasicString.hxx:1282
iterator begin()
Returns the begin iterator of this string.
Definition: BasicString.hxx:847
BasicString(const Allocator &alloc)
This constructor creates an empty string instance.
Definition: BasicString.hxx:80
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:1311
SelfType & Insert(size_type offset, const CharType *pChars, size_type count)
This operation inserts the as argument passed string partially.
Definition: BasicString.hxx:542
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:180
Root namespace for the PLCnext API
size_type Capacity() const
Rceturns the capacity of this string.
Definition: BasicString.hxx:1092
SelfType & operator=(const CharType *right)
This assignment operator copies the right-hand-side operand to this string.
Definition: BasicString.hxx:259
SelfType & Replace(const_iterator first, const_iterator last, std::initializer_list< CharType > chars)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:670
SelfType & Replace(size_type offset, size_type length, const SelfType &arg)
Replaces a range of chars.
Definition: BasicString.hxx:681
Allocator::const_pointer const_pointer
The const pointer type of this type.
Definition: BasicString.hxx:47
const_reverse_iterator ConstReverseEnd() const
Returns the end iterator of this const string for reverse iterating.
Definition: BasicString.hxx:957
SelfType & operator=(CharType c)
This assignment operator copies the right-hand-side operand to this string.
Definition: BasicString.hxx:268
Arp::BasicString< C, Alloc > argument_type
The argument type of this functor class (stl policy type)
Definition: BasicString.hxx:1981
const_iterator begin() const
Returns the begin iterator of this string.
Definition: BasicString.hxx:855
SelfType & Replace(const_iterator first, const_iterator last, const_iterator first2, const_iterator last2)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:799
reverse_iterator ReverseEnd()
Returns the end iterator of this string for reverse iterating.
Definition: BasicString.hxx:922
SelfType & Append(const CharType *pChars, size_type count)
This operation appends the as argument passed C-string partially.
Definition: BasicString.hxx:454
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:1349
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:1752
const_iterator end() const
Returns the end iterator of this string.
Definition: BasicString.hxx:871
C CharType
The character type.
Definition: BasicString.hxx:35
SelfType & Assign(iterator first, iterator last)
Copies the sequence of characters in the range [first,last), in the same order.
Definition: BasicString.hxx:397
SelfType & Append(const CharType *pChars)
This operation appends the as argument passed C-string.
Definition: BasicString.hxx:462
SelfType & Replace(const_iterator first, const_iterator last, pointer first2, pointer last2)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:823
SelfType & Insert(size_type offset, const SelfType &arg)
This operation inserts the the argument at the given position.
Definition: BasicString.hxx:519
bool operator>=(const BasicString< CharType, Alloc > &left, const BasicString< CharType, Alloc > &right)
Compares the left string to the right string.
Definition: BasicString.hxx:1932
const_reverse_iterator ReverseEnd() const
Returns the end iterator of this string for reverse iterating.
Definition: BasicString.hxx:929
const_reference Front() const
Returns a const reference to the first character in the string.
Definition: BasicString.hxx:996
BasicString()
The default constructor constructs an empty string instance.
Definition: BasicString.hxx:58
iterator Insert(const_iterator where, iterator first, iterator last)
Inserts a range of chars [first;last) at position where .
Definition: BasicString.hxx:600
SelfType & Insert(size_type offset, size_type count, CharType c)
Inserts count consecutive copies of character c at position offset .
Definition: BasicString.hxx:563
SelfType & Replace(size_type offset, size_type length, size_type count, CharType c)
Replaces a range of chars by a character.
Definition: BasicString.hxx:729
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:406
const_iterator Begin() const
Returns the begin iterator of this string.
Definition: BasicString.hxx:887
const_reference operator[](size_type offset) const
Returns a const reference to the character at position offset .
Definition: BasicString.hxx:1048
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:1339
const_iterator ConstBegin() const
Returns the begin iterator of this const string.
Definition: BasicString.hxx:936
BasicString(const CharType *pChars, const Allocator &alloc)
This constructor copies the as argument passed C-string.
Definition: BasicString.hxx:131
SelfType & Assign(const SelfType &arg, size_type offset, size_type count=NPos)
This operation copies the as argument passed string partially.
Definition: BasicString.hxx:344
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:278
result_type operator()(const argument_type &key) const
This functor operator returns the hash value of the as argument passed string.
Definition: BasicString.hxx:1989
BasicString(const BaseString &arg)
This copy constructor copies the as argument passed std::string to this string.
Definition: BasicString.hxx:196
int Compare(const CharType *pOther) const
Compares this string to the pOther string lexicographical.
Definition: BasicString.hxx:1424
SelfType & Assign(BaseString &&arg)
This operation moves the argument to this string.
Definition: BasicString.hxx:362
BasicString(const CharType *pChars, size_type count)
This constructor copies the as argument passed C-string.
Definition: BasicString.hxx:107
BasicString< CharType, Allocator > SelfType
The self type.
Definition: BasicString.hxx:36
SelfType & Replace(const_iterator first, const_iterator last, const SelfType &arg)
Replaces a range of chars [first;last).
Definition: BasicString.hxx:740
SelfType & Append(iterator first, iterator last)
Appends the sequence of characters in the range [first,last), in the same order.
Definition: BasicString.hxx:480
Allocator allocator_type
The allocator type of this type.
Definition: BasicString.hxx:40
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:531
SelfType & Assign(const CharType *pChars, size_type count)
This operation copies the as argument passed C-string partially.
Definition: BasicString.hxx:371
void PopBack()
Removes the character at the end of this string.
Definition: BasicString.hxx:977
BasicString(const CharType *pChars)
This constructor copies the as argument passed C-string.
Definition: BasicString.hxx:123
iterator Insert(const_iterator where, CharType c)
Inserts character c at position where .
Definition: BasicString.hxx:580
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:510
SelfType & Replace(size_type offset, size_type length, const CharType *pChars)
Replaces a range of chars.
Definition: BasicString.hxx:717
SelfType & Assign(const CharType *pChars)
This operation copies the as argument passed C-string.
Definition: BasicString.hxx:379
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:241
const_reference At(size_type offset) const
Returns a const reference to the character at position offset .
Definition: BasicString.hxx:1030
SelfType & Assign(size_type count, CharType c)
Fills this string with count consecutive copies of character c .
Definition: BasicString.hxx:388
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:1301
reference Front()
Returns a reference to the first character in the string.
Definition: BasicString.hxx:988
bool operator<=(const BasicString< CharType, Alloc > &left, const BasicString< CharType, Alloc > &right)
Compares the left string to the right string.
Definition: BasicString.hxx:1896
BasicString(const SelfType &arg)
The copy constructor copies the as argument passed string deeply.
Definition: BasicString.hxx:65
const_reverse_iterator ConstReverseBegin() const
Returns the begin iterator of this const string for reverse iterating.
Definition: BasicString.hxx:950
BasicString(SelfType &&arg, const Allocator &alloc)
This move constructor moves the as argument passed string to this string.
Definition: BasicString.hxx:163
BasicString(const SelfType &arg, size_type offset, size_type count=NPos)
This constructor copies the as argument passed string partially.
Definition: BasicString.hxx:89