ADTF
stackstring.h
Go to the documentation of this file.
1 
7 #ifndef _STACKSTRING_CLASS_HEADER_
8 #define _STACKSTRING_CLASS_HEADER_
9 
10 namespace A_UTILS_NS
11 {
13 #define stack_string_baseData_OUT_OF_RANGE_ASSERT tFalse
17 {
18 };
19 
23 {
24 };
25 
28 template<typename DATASTORE>
29 struct stack_string_data_handler // empty impl
30 {
31 
32 };
33 
36 {
38  typedef tChar value_type;
40  typedef tSize size_type;
41 
44  {
45  Init();
46  }
47  stack_string_data_handler(const stack_string_data_handler& oHandler) = delete;
48  stack_string_data_handler& operator=(const stack_string_data_handler& oHandler) = delete;
49 
51  stack_string_data_handler& operator=(stack_string_data_handler&& oHandler) = delete;
52 
55  {
56  Deinit();
57  }
58 
61  {
62  m_szCurrentCapacity = 0;
63  m_pGrownSize = nullptr;
64  }
65 
68  {
69  if (m_pGrownSize != nullptr)
70  {
71  delete [] m_pGrownSize;
72  m_pGrownSize = nullptr;
73  m_szCurrentCapacity = 0;
74  }
75  }
76 
78  size_type GetCapacity(const size_type& szFixCapacity) const
79  {
80  if (m_pGrownSize != nullptr)
81  {
82  return m_szCurrentCapacity;
83  }
84  return szFixCapacity;
85  }
86 
88  size_type GetMaxSize(const size_type& /* szFixCapacity */) const
89  {
90  // by default, the maximum usable size is one less than the
91  // g_npos, which is std::numeric_limits<size_t>::max()
92  return (g_npos - 1);
93  }
94 
96  tVoid Resize(value_type* pFixDataArray,
97  const size_type& szFixCapacity,
98  const size_type& szNewCapacity)
99  {
100  if (szNewCapacity <= GetCapacity(szFixCapacity))
101  {
102  if (szNewCapacity <= szFixCapacity)
103  {
104  if (m_pGrownSize)
105  {
106  cStringUtil::Copy(pFixDataArray, m_pGrownSize, szNewCapacity, szFixCapacity + 1);
107  delete[] m_pGrownSize;
108  m_pGrownSize = nullptr;
109  }
110  else
111  {
112  pFixDataArray[szNewCapacity] = '\0';
113  }
114  }
115  else
116  {
117  m_pGrownSize[szNewCapacity] = '\0';
118  }
119  }
120  else
121  {
122  size_type szNewCapacityAlloc = szNewCapacity + (szNewCapacity * 2) / 3;
123  value_type* const pNewStore = new (std::nothrow) value_type[szNewCapacityAlloc + 1] {};
124  if (nullptr == pNewStore)
125  {
126  return;
127  }
128 
129  pNewStore[0] = '\0';
130  if (m_pGrownSize)
131  {
132  cStringUtil::Copy(pNewStore, m_pGrownSize, cStringUtil::InvalidPos, szNewCapacityAlloc + 1);
133  delete [] m_pGrownSize;
134  }
135  else
136  {
137  cStringUtil::Copy(pNewStore, pFixDataArray, cStringUtil::InvalidPos, szNewCapacityAlloc + 1);
138  }
139  m_pGrownSize = pNewStore;
140  m_szCurrentCapacity = szNewCapacityAlloc;
141  }
142  }
143 
145  const value_type* GetCData(const value_type* pFixDataArray) const
146  {
147  if (m_pGrownSize != nullptr)
148  {
149  return m_pGrownSize;
150  }
151  return pFixDataArray;
152  }
153 
155  value_type* GetData(value_type* pFixDataArray)
156  {
157  if (m_pGrownSize != nullptr)
158  {
159  return m_pGrownSize;
160  }
161  return pFixDataArray;
162  }
163 private:
168 };
169 
172 {
174  typedef tChar value_type;
176  typedef tSize size_type;
177 
179  size_type GetCapacity(const size_type& szFixCapacity) const
180  {
181  return szFixCapacity;
182  }
183 
185  size_type GetMaxSize(const size_type& szFixCapacity) const
186  {
187  return szFixCapacity;
188  }
189 
191  tVoid Resize(value_type* pFixDataArray,
192  const size_type& szFixCapacity,
193  const size_type& szNewCapacity)
194  {
195  if (szNewCapacity <= GetCapacity(szFixCapacity))
196  {
197  pFixDataArray[szNewCapacity] = '\0';
198  }
199  else
200  {
202  }
203  }
204 
206  const value_type* GetCData(const value_type* pFixDataArray) const
207  {
208  return pFixDataArray;
209  }
210 
212  value_type* GetData(value_type* pFixDataArray)
213  {
214  return pFixDataArray;
215  }
216 };
217 
219 template<tSize TSIZE, typename datastoreT>
221 {
222 private:
225 public:
227  typedef typename datastoreHandler::value_type value_type;
229  typedef typename datastoreHandler::size_type size_type;
230 
235  {
236  }
237 
242  {
243  }
244 
247  {
248  }
249 
252  {
253  return *this;
254  }
255 
258  {
259  }
260 
263  {
264  return *this;
265  }
266 
269  {
270  return m_oDataHandler.GetCapacity(TSIZE);
271  }
274  {
275  return m_oDataHandler.GetMaxSize(TSIZE);
276  }
278  tVoid resize(size_type szNewSize)
279  {
280  m_oDataHandler.Resize(&m_oData[0], TSIZE, szNewSize);
281  }
282 
285  {
286  return m_oDataHandler.GetData(&m_oData[0]);
287  }
288 
290  const value_type* cdata() const
291  {
292  return m_oDataHandler.GetCData(&m_oData[0]);
293  }
294 private:
298  value_type m_oData[TSIZE + 1];
299 };
300 
302 template <tSize TSIZE, typename datastoreType = assert_out_of_range>
303 class stack_string_base : public stack_string_data<TSIZE, datastoreType>
304 {
305  public:// public definitions
306  //StorageType
312  typedef typename _myBase::value_type value_type;
314  typedef typename _myBase::size_type size_type;
319 
321  typedef std::reverse_iterator<iterator> reverse_iterator;
323  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
324 
325  //bring base methods into scope
326  using _myBase::capacity;
327  using _myBase::data;
328  using _myBase::cdata;
329  using _myBase::resize;
330 
331  public:
333  static const tSize InvalidPos = g_npos;
334  public:
337  {
338  clear();
339  }
340 
343  {
344  assign(strValue);
345  }
346 
349  {
350  assign(strValue);
351  return *this;
352  }
353 
355  template <tSize T2, typename dT2>
357  {
358  assign(strValue);
359  }
360 
362  template <tSize T2, typename dT2>
364  {
365  assign(strValue);
366  return *this;
367  }
368 
371  {
372  //we can not move it !! its not on heap
373  assign(strValue);
374  }
375 
384  {
385  assign(strValue);
386  return *this;
387  }
388 
390  template <tSize T2, typename dT2>
392  {
393  //we can not move it !! its not on heap
394  assign(strValue);
395  }
396 
404  template <tSize T2, typename dT2>
406  {
407  assign(strValue);
408  return *this;
409  }
410 
413  {
414  }
415 
418  {
419  return iterator(data());
420  }
421 
424  {
425  return iterator(&(data()[length()]));
426  }
427 
430  {
431  return reverse_iterator(&(data()[length()]));
432  }
433 
436  {
437  return reverse_iterator(data());
438  }
439 
442  {
443  return const_iterator(data());
444  }
445 
448  {
449  return const_iterator(&(data()[length()]));
450  }
451 
454  {
455  return const_reverse_iterator(&(data()[length()]));
456  }
457 
460  {
461  return const_reverse_iterator(data());
462  }
463 
465  const value_type* c_str() const
466  {
467  return cdata();
468  }
469 
472  {
473  return cStringUtil::GetLength(c_str());
474  }
475 
478  {
479  data()[0] = '\0';
480  }
481 
491  {
492  if (szCount != InvalidPos)
493  {
494  size_type szMax = capacity();
495  size_type szCurrentLength = length();
496  if (szCurrentLength + szCount > capacity())
497  {
498  resize(szCurrentLength + szCount);
499  //check whether alloc failed
500  if ((szCurrentLength + szCount) > capacity())
501  {
502  return *this;
503  }
504  szMax = capacity();
505  }
506  size_type nIdx = szCurrentLength;
507  for (;nIdx < szCurrentLength + szCount && nIdx < szMax;
508  ++nIdx)
509  {
510  data()[nIdx] = c;
511  }
512  data()[nIdx] = '\0';
513  }
514  return *this;
515  }
516 
528  template <tSize T2, typename dT2>
530  {
531  size_type szCurrentLength = length();
532  size_type szToAppendLength = strValue.length();
533  if (nLength != InvalidPos)
534  {
535  if (nLength < szToAppendLength)
536  {
537  szToAppendLength = nLength;
538  }
539  }
540  if (nPos >= szToAppendLength)
541  {
542  return *this;
543  }
544  size_type szMax = capacity();
545  if (szCurrentLength + szToAppendLength > capacity())
546  {
547  resize(szCurrentLength + szToAppendLength);
548  //check whether alloc failed
549  if (szCurrentLength + szToAppendLength > capacity())
550  {
551  return *this;
552  }
553  szMax = capacity();
554  }
555  cStringUtil::Copy(&(data()[szCurrentLength]), &(strValue.c_str()[nPos]), szToAppendLength, (szMax + 1) - szCurrentLength);
556  return *this;
557  }
558 
568  template <tSize T2, typename dT2>
570  {
571  return append(strValue, 0, nLength);
572  }
573 
582  template <tSize T2, typename dT2>
584  {
585  return assign(strValue.c_str(), 0, strValue.length());
586  }
587 
599  template <tSize T2, typename dT2>
600  _myType& assign(const stack_string_base<T2, dT2>& strValue, tSize nPos, tSize nLength)
601  {
602  return assign(strValue.c_str(), nPos, nLength);
603  }
604 
616  _myType& assign(const value_type* pChar, tSize nLength = InvalidPos)
617  {
618  return assign(pChar, 0, nLength);
619  }
620 
630  _myType& assign(size_type nCount, value_type cCharacter)
631  {
632  if (nCount > capacity())
633  {
634  resize(nCount);
635  //check whether alloc failed
636  if (nCount > capacity())
637  {
638  return *this;
639  }
640  }
641 
642  if (nCount > 0)
643  {
644  cStringUtil::Repeat(data(), capacity() + 1, nCount, cCharacter);
645  }
646  else
647  {
648  clear();
649  }
650  return *this;
651  }
652 
664  _myType& assign(const value_type* strValue, tSize nPos, tSize nLength)
665  {
666  tSize szLengthToAppend = cStringUtil::GetLength(strValue, nLength);
667  if (nPos == InvalidPos)
668  {
669  nPos = 0;
670  }
671  if (nPos >= szLengthToAppend)
672  {
673  clear();
674  return *this;
675  }
676  else
677  {
678  szLengthToAppend -= nPos;
679  }
680  if (nLength != InvalidPos)
681  {
682  if (nLength < szLengthToAppend)
683  {
684  szLengthToAppend = nLength;
685  }
686  }
687  if (capacity() < szLengthToAppend)
688  {
689  resize(szLengthToAppend);
690  //check whether alloc failed
691  if (capacity() < szLengthToAppend)
692  {
693  return *this;
694  }
695  }
696  cStringUtil::Copy(data(), &strValue[nPos], szLengthToAppend, capacity() + 1);
697  return *this;
698  }
699 
707  const value_type& operator[](size_type nIdx) const
708  {
709  return cdata()[nIdx];
710  }
711 
720  {
721  return data()[nIdx];
722  }
723 
737  template <tSize T2, typename dT2>
738  _myType& insert(tSize szInsertPos,
739  const stack_string_base<T2, dT2>& strValue,
740  tSize szFromPos,
741  tSize szLength)
742  {
743  tSize szLengthToInsert = strValue.length();
744  tSize szLengthMyLength = length();
745 
746  //check for valid insertpos
747  if (szInsertPos == InvalidPos)
748  {
749  szInsertPos = 0;
750  }
751  else if (szInsertPos > szLengthMyLength)
752  {
753  szInsertPos = szLengthMyLength;
754  }
755 
756  //check for valid pos of given value
757  if (szFromPos == InvalidPos)
758  {
759  szFromPos = 0;
760  }
761  else if (szFromPos >= szLengthToInsert)
762  {
763  return *this;
764  }
765  //check for valid insert Length
766  szLengthToInsert = cStringUtil::GetLength(&strValue[szFromPos]);
767  if (szLength < szLengthToInsert && szLength != InvalidPos)
768  {
769  szLengthToInsert = szLength;
770  }
771 
772  if (szLengthMyLength + szLengthToInsert > capacity())
773  {
774  resize(szLengthMyLength + szLengthToInsert);
775  //check whether alloc failed
776  if (szLengthMyLength + szLengthToInsert > capacity())
777  {
778  return *this;
779  }
780  }
781 
782  const tChar* pFromChar = &strValue[szFromPos];
783  cStringUtil::PushFront(&(data()[szInsertPos]), (capacity() + 1) - szInsertPos, pFromChar, szLengthToInsert);
784  return *this;
785  }
786 
799  {
800  cStringUtil::Delete(data(), nPos, szLength);
801  return *this;
802  }
803 
816  template <tSize T2, typename dT2>
817  size_type find(const stack_string_base<T2, dT2>& strValue, size_type nStartPos = 0) const
818  {
819  size_type szCurrentLength = length();
820  size_type szFindLength = strValue.length();
821  if (nStartPos == InvalidPos)
822  {
823  nStartPos = 0;
824  }
825  if (nStartPos > szCurrentLength)
826  {
827  return InvalidPos;
828  }
829  if (szFindLength == 0)
830  {
831  return nStartPos;
832  }
833  value_type aToken[2];
834  aToken[0] = strValue[0];
835  aToken[1] = '\0';
836  size_type szCurrentBeginPos = nStartPos;
837  while (szCurrentBeginPos + szFindLength <= szCurrentLength)
838  {
839  size_type szFirstOf = cStringUtil::FindFirstOfToken(c_str(), aToken, szCurrentBeginPos);
840  if (szFirstOf != InvalidPos)
841  {
842  szCurrentBeginPos = szFirstOf;
843  if (cStringUtil::IsEqual(&(c_str()[szCurrentBeginPos]), strValue.c_str(), szFindLength))
844  {
845  return szCurrentBeginPos;
846  }
847  else
848  {
849  szCurrentBeginPos++;
850  }
851  }
852  else
853  {
854  return InvalidPos;
855  }
856  }
857  return InvalidPos;
858  }
859 
870  _myType substr(size_type nPos, size_type nLength = InvalidPos) const
871  {
872  _myType strRes;
873  size_type szCurrentLength = length();
874  if (nPos == InvalidPos)
875  {
876  nPos = 0;
877  }
878  if (nPos >= szCurrentLength)
879  {
880  return strRes;
881  }
882  if (nLength == InvalidPos)
883  {
884  nLength = szCurrentLength - nPos;
885  }
886  strRes.assign(&(cdata()[nPos]), nLength);
887  return strRes;
888  }
889 
897  template <tSize T2, typename dT2>
899  {
900  stack_string_base<T2, dT2> strSwapValue;
901  strSwapValue.assign(*this);
902  assign(strValue);
903  strValue.assign(strSwapValue);
904  }
905 
916  size_type rfind(tChar cValue, size_type nStartPos = InvalidPos) const
917  {
918  value_type aToken[2];
919  aToken[0] = cValue;
920  aToken[1] = '\0';
921  return cStringUtil::RFindFirstOfToken(c_str(), aToken, nStartPos);
922  }
923 
934  template <tSize T2, typename dT2>
935  size_type find_first_of(const stack_string_base<T2, dT2>& strValue, size_type nStartPos = 0) const
936  {
937  return cStringUtil::FindFirstOfToken(c_str(), strValue.c_str(), nStartPos);
938  }
939 
950  template <tSize T2, typename dT2>
951  size_type find_first_not_of(const stack_string_base<T2, dT2>& strValue, size_type nStartPos = 0) const
952  {
953  return cStringUtil::FindFirstNotOfToken(c_str(), strValue.c_str(), nStartPos);
954  }
955 };
956 
957 } // namespace A_UTILS_NS
958 
959 
960 
961 
962 #endif // _STACKSTRING_CLASS_HEADER_
#define A_UTILS_ASSERT
This macro is used for platform independent assertion expressions.
char tChar
The tChar defines the type for platform character set (platform and compiler dependent type).
void tVoid
The tVoid is always the definition for the void (non-type).
size_t tSize
type definition for a array size values, map size values etc.
static const tSize InvalidPos
used to identicate out of range, invalidpos or default length
Definition: stringutil.h:25
static tSize RFindFirstOfToken(const tChar *strString, const tChar *strTokenList, tSize szStartPos=InvalidPos, tSize nLength=InvalidPos)
This function searches the string for the last occurrence of a token (character) that is also contain...
static tChar * Delete(tChar *strString, tSize nPos, tSize nLength=InvalidPos)
This function deletes characters from a string.
static tSize GetLength(const tChar *pcStr)
Returns the length of the string.
static tChar * Copy(tChar *pstrDestination, const tChar *pstrSource, tSize nCount=InvalidPos, tSize nDestinationBufferSize=InvalidPos)
Copies a null terminated string to another string buffer.
static tSize FindFirstOfToken(const tChar *strString, const tChar *strTokenList, tSize szStartPos=0, tSize nLength=InvalidPos)
This function searches the string for the first occurrence of a token (character) that is also contai...
static tSize FindFirstNotOfToken(const tChar *strString, const tChar *strTokenList, tSize szStartPos=0, tSize nLength=InvalidPos)
This function searches the string for the first occurrence of a token (character) that is not also co...
static tChar * PushFront(tChar *strDest, tSize szDestSize, const tChar *strSource, tSize nCount)
This function adds the content of one string to the beginning of another string.
static tBool IsEqual(const tChar *str1, const tChar *str2, tSize nPos, tSize nLength)
This function checks if the two strings are equal (case sensitive)
static tChar * Repeat(tChar *strDest, tSize szDestSize, tSize nCount, tChar cCharacter)
Fill a string with a repetitive character sequence.
_myType & append(const stack_string_base< T2, dT2 > &strValue, size_type nPos, size_type nLength)
Appends a copy of a substring of strValue.
Definition: stackstring.h:529
static const tSize InvalidPos
used to identicate out of range, invalidpos or default length
Definition: stackstring.h:333
void swap(stack_string_base< T2, dT2 > &strValue)
Swap string values.
Definition: stackstring.h:898
stack_string_base & operator=(const stack_string_base< T2, dT2 > &strValue)
String assignement.
Definition: stackstring.h:363
const value_type * cdata() const
Get C string.
Definition: stackstring.h:290
_myBase::value_type value_type
definition value type
Definition: stackstring.h:312
size_type rfind(tChar cValue, size_type nStartPos=InvalidPos) const
Searches the string for the last occurrence of a character.
Definition: stackstring.h:916
stack_string_base & operator=(_myType &&strValue)
Assignment operator.
Definition: stackstring.h:383
_myType & assign(const value_type *strValue, tSize nPos, tSize nLength)
Assigns a new value to the string, replacing its current contents.
Definition: stackstring.h:664
_myType & assign(const stack_string_base< T2, dT2 > &strValue)
Assigns a new value to the string, replacing its current contents.
Definition: stackstring.h:583
size_type find_first_not_of(const stack_string_base< T2, dT2 > &strValue, size_type nStartPos=0) const
Searches the string for the first character that does not match any of the characters in strValue.
Definition: stackstring.h:951
stack_string_base< TSIZE, datastoreType > _myType
definition my type
Definition: stackstring.h:308
_myType & assign(const value_type *pChar, tSize nLength=InvalidPos)
Assigns a new value to the string, replacing its current contents.
Definition: stackstring.h:616
_myType & insert(tSize szInsertPos, const stack_string_base< T2, dT2 > &strValue, tSize szFromPos, tSize szLength)
Insert into string.
Definition: stackstring.h:738
const_iterator cbegin() const
Return const_iterator to beginning.
Definition: stackstring.h:441
_myType & assign(size_type nCount, value_type cCharacter)
Assigns a new value to the string, replacing its current contents.
Definition: stackstring.h:630
std::reverse_iterator< const_iterator > const_reverse_iterator
short typedefinition for string reverse const_iterators
Definition: stackstring.h:323
_myType & append(const stack_string_base< T2, dT2 > &strValue, size_type nLength=InvalidPos)
Appends a copy of of the first nLength characters of strValue.
Definition: stackstring.h:569
size_type find_first_of(const stack_string_base< T2, dT2 > &strValue, size_type nStartPos=0) const
Searches the string for the first character that matches any of the characters in strValue.
Definition: stackstring.h:935
reverse_iterator rend()
Return reverse iterator to reverse end.
Definition: stackstring.h:435
value_type * data()
Get string data.
Definition: stackstring.h:284
_myType & assign(const stack_string_base< T2, dT2 > &strValue, tSize nPos, tSize nLength)
Assigns a new value to the string, replacing its current contents.
Definition: stackstring.h:600
_myType & append(size_type szCount, value_type c)
Appends szCount consecutive copies of character c.
Definition: stackstring.h:490
const_reverse_iterator crbegin() const
Return reverse const_iterator to reverse beginning.
Definition: stackstring.h:453
simple_pointer_iterator< const value_type > const_iterator
short typedefinition for string const_iterators
Definition: stackstring.h:318
size_type find(const stack_string_base< T2, dT2 > &strValue, size_type nStartPos=0) const
Searches the string for the first occurrence of strValue.
Definition: stackstring.h:817
value_type & operator[](size_type nIdx)
Get character of string.
Definition: stackstring.h:719
std::reverse_iterator< iterator > reverse_iterator
short typedefinition for string reverse iterators
Definition: stackstring.h:321
const_iterator cend() const
Return const_iterator to end.
Definition: stackstring.h:447
_myBase::size_type size_type
definition size type
Definition: stackstring.h:314
stack_string_base(stack_string_base< T2, dT2 > &&strValue)
Constructor.
Definition: stackstring.h:391
tVoid resize(size_type szNewSize)
Resize string.
Definition: stackstring.h:278
_myType & erase(size_type nPos, size_type szLength=InvalidPos)
Erases the portion of the string value that begins at the character position nPos and spans szLength ...
Definition: stackstring.h:798
const value_type * c_str() const
Get C string.
Definition: stackstring.h:465
const value_type & operator[](size_type nIdx) const
Get character of string.
Definition: stackstring.h:707
const_reverse_iterator crend() const
Return reverse const_iterator to reverse end.
Definition: stackstring.h:459
size_type length() const
Return length of string.
Definition: stackstring.h:471
stack_string_base(const _myType &strValue)
Constructor.
Definition: stackstring.h:342
iterator end()
Return iterator to end.
Definition: stackstring.h:423
reverse_iterator rbegin()
Return reverse iterator to reverse beginning.
Definition: stackstring.h:429
size_type capacity() const
Return size of allocated storage.
Definition: stackstring.h:268
simple_pointer_iterator< value_type > iterator
short typedefinition for string iterators
Definition: stackstring.h:316
stack_string_base(_myType &&strValue)
Constructor.
Definition: stackstring.h:370
iterator begin()
Return iterator to beginning.
Definition: stackstring.h:417
_myType substr(size_type nPos, size_type nLength=InvalidPos) const
Returns a newly constructed string object with its value initialized to a copy of a substring of this...
Definition: stackstring.h:870
stack_string_data< TSIZE, datastoreType > _myBase
definition my base
Definition: stackstring.h:310
stack_string_base & operator=(const _myType &strValue)
String assignement.
Definition: stackstring.h:348
tVoid clear()
Clear string content.
Definition: stackstring.h:477
stack_string_base & operator=(stack_string_base< T2, dT2 > &&strValue)
Assignment operator.
Definition: stackstring.h:405
stack_string_base(const stack_string_base< T2, dT2 > &strValue)
Constructor.
Definition: stackstring.h:356
Stacked String Data.
Definition: stackstring.h:221
const value_type * cdata() const
Get C string.
Definition: stackstring.h:290
datastoreHandler::size_type size_type
short typedefinition for size_type
Definition: stackstring.h:229
stack_string_data & operator=(const stack_string_data &oStackData)
String assignment.
Definition: stackstring.h:251
stack_string_data(const stack_string_data &oStackData)
Constructor.
Definition: stackstring.h:246
stack_string_data(stack_string_data &&oStackData)
Constructor.
Definition: stackstring.h:257
value_type * data()
Get string data.
Definition: stackstring.h:284
value_type m_oData[TSIZE+1]
Internally used data.
Definition: stackstring.h:298
stack_string_data & operator=(stack_string_data &&oStackData)
String assignment.
Definition: stackstring.h:262
datastoreHandler::value_type value_type
short typedefinition for value_type
Definition: stackstring.h:227
size_type max_size() const
Return maximum size of string.
Definition: stackstring.h:273
datastoreHandler m_oDataHandler
Internally used instance.
Definition: stackstring.h:296
tVoid resize(size_type szNewSize)
Resize string.
Definition: stackstring.h:278
size_type capacity() const
Return size of allocated storage.
Definition: stackstring.h:268
virtual ~stack_string_data()
Destructor.
Definition: stackstring.h:241
stack_string_data_handler< datastoreT > datastoreHandler
definition of datastoreHandler
Definition: stackstring.h:224
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.
Definition: d_ptr.h:11
#define stack_string_baseData_OUT_OF_RANGE_ASSERT
OUT_OF_RANGE_ASSERT.
Definition: stackstring.h:13
static string option for stack_string
Definition: stackstring.h:17
grow in heap option for stack_string
Definition: stackstring.h:23
value_type * GetData(value_type *pFixDataArray)
Get string data.
Definition: stackstring.h:212
tVoid Resize(value_type *pFixDataArray, const size_type &szFixCapacity, const size_type &szNewCapacity)
Resize string.
Definition: stackstring.h:191
size_type GetMaxSize(const size_type &szFixCapacity) const
Return the maximum string size.
Definition: stackstring.h:185
size_type GetCapacity(const size_type &szFixCapacity) const
Return size of allocated storage.
Definition: stackstring.h:179
const value_type * GetCData(const value_type *pFixDataArray) const
Get string data.
Definition: stackstring.h:206
value_type * GetData(value_type *pFixDataArray)
Get string data.
Definition: stackstring.h:155
tVoid Resize(value_type *pFixDataArray, const size_type &szFixCapacity, const size_type &szNewCapacity)
Resize string.
Definition: stackstring.h:96
size_type GetMaxSize(const size_type &) const
Return maximum size of string.
Definition: stackstring.h:88
size_type GetCapacity(const size_type &szFixCapacity) const
Return size of allocated storage.
Definition: stackstring.h:78
const value_type * GetCData(const value_type *pFixDataArray) const
Get string data.
Definition: stackstring.h:145
Stacked String Data Handler.
Definition: stackstring.h:30