EpcTools
An event based multi-threaded C++ development framework.
eostring.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2020 Sprint
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 
17 #ifndef __EOSTRING_H
18 #define __EOSTRING_H
19 
20 #include <string>
21 #include <iostream>
22 #include <vector>
23 
24 #include "eerror.h"
25 #include "ehash.h"
26 
29 
30 DECLARE_ERROR(EOctetString_OutOfRange);
31 
34 {
35 public:
36  typedef size_t size_type;
37  static const size_type npos { std::string::npos };
38 
41  : capacity_(0),
42  length_(0),
43  data_(NULL)
44  {
45  reserve(minCapacity_);
46  }
49  EOctetString(size_type n)
50  : capacity_(0),
51  length_(0),
52  data_(NULL)
53  {
54  reserve(n);
55  }
58  EOctetString(cpStr s)
59  : capacity_(0),
60  length_(0),
61  data_(NULL)
62  {
63  size_type n = strlen(s);
64  reserve(n);
65  assign(s);
66  }
70  EOctetString(cpUChar data, size_type n)
71  : capacity_(0),
72  length_(0),
73  data_(NULL)
74  {
75  reserve(n);
76  assign(data, n);
77  }
81  : capacity_(0),
82  length_(0),
83  data_(NULL)
84  {
85  *this = ostr;
86  }
93  EOctetString(const EOctetString &ostr, size_type pos, size_type len = npos)
94  : capacity_(0),
95  length_(0),
96  data_(NULL)
97  {
98  assign(ostr, pos, len);
99  }
102  {
103  dealloc();
104  }
105 
108  EOctetString &operator=(const EOctetString &ostr) { return assign(ostr); }
111  EOctetString &operator=(cpStr s) { return assign(s); }
114  EOctetString &operator=(Char c) { return assign(1, c); }
117  EOctetString &operator=(UChar c) { return assign(1, c); }
120  EOctetString &operator=(EOctetString &&ostr) { return assign(std::move(ostr)); }
121 
124  EOctetString &operator+=(const EOctetString &ostr) { return append(ostr); }
127  EOctetString &operator+=(cpStr s) { return append(s); }
130  EOctetString &operator+=(Char c) { return append((UChar)c); }
133  EOctetString &operator+=(UChar c) { return append(c); }
134 
138  UChar &operator[](size_type pos) { if (pos >= length_) throw EOctetString_OutOfRange(); return data_[pos]; }
139  cUChar &operator[](size_type pos) const { if (pos >= length_) throw EOctetString_OutOfRange(); return data_[pos]; }
141 
144  bool operator==(const EOctetString &ostr) const { return compare(ostr) == 0; }
147  bool operator!=(const EOctetString &ostr) const { return compare(ostr) != 0; }
150  bool operator<(const EOctetString &ostr) const { return compare(ostr) < 0; }
153  bool operator>(const EOctetString &ostr) const { return compare(ostr) > 0; }
156  bool operator<=(const EOctetString &ostr) const { return !(compare(ostr) > 0); }
159  bool operator>=(const EOctetString &ostr) const { return !(compare(ostr) < 0); }
160 
163  bool operator==(cpStr str) const { return compare(str) == 0; }
166  bool operator!=(cpStr str) const { return compare(str) != 0; }
169  bool operator<(cpStr str) const { return compare(str) < 0; }
172  bool operator>(cpStr str) const { return compare(str) > 0; }
175  bool operator<=(cpStr str) const { return !(compare(str) > 0); }
178  bool operator>=(cpStr str) const { return !(compare(str) < 0); }
179 
183  {
184  return append(ostr.data_, ostr.length_);
185  }
190  EOctetString &append(const EOctetString &ostr, size_type subpos, size_type sublen)
191  {
192  if (subpos >= ostr.length_)
193  throw EOctetString_OutOfRange();
194 
195  return append(&ostr.data_[subpos], sublen);
196  }
200  {
201  return append(reinterpret_cast<cpUChar>(s), strlen(s));
202  }
206  EOctetString &append(cpStr s, size_type n)
207  {
208  return append(reinterpret_cast<cpUChar>(s), n);
209  }
212  EOctetString &append(cUChar c)
213  {
214  if (length_ + 1 > capacity_)
215  {
216  size_type newCapacity = capacity_;
217  while (newCapacity < length_ + 1)
218  newCapacity *= 2;
219  reserve(newCapacity);
220  }
221  data_[length_++] = c;
222  return *this;
223  }
227  EOctetString &append(cpUChar data, size_type n)
228  {
229  if (length_ + n > capacity_)
230  {
231  size_type newCapacity = capacity_;
232  while (newCapacity < length_ + n)
233  newCapacity *= 2;
234  reserve(newCapacity);
235  }
236  memcpy(&data_[length_], data, n);
237  length_ += n;
238  return *this;
239  }
243  EOctetString &append(size_type n, UChar c)
244  {
245  if (length_ + n > capacity_)
246  {
247  size_type newCapacity = capacity_;
248  while (newCapacity < length_ + n)
249  newCapacity *= 2;
250  reserve(newCapacity);
251  }
252  memset(&data_[length_], c, n);
253  length_ += n;
254  return *this;
255  }
256 
260  {
261  if (capacity_ < ostr.capacity_)
262  alloc(ostr.capacity_);
263  length_ = ostr.length_;
264  memcpy(data_, ostr.data_, length_);
265  return *this;
266  }
271  EOctetString &assign(const EOctetString &ostr, size_type subpos, size_type sublen)
272  {
273  if (subpos >= ostr.length_)
274  throw EOctetString_OutOfRange();
275 
276  size_type len = std::min(ostr.length_ - subpos, sublen);
277  if (capacity_ < len)
278  alloc(len);
279  length_ = len;
280  memcpy(data_, &ostr.data_[subpos], length_);
281  return *this;
282  }
286  {
287  size_type len = strlen(s);
288  if (capacity_ < len)
289  alloc(len);
290  length_ = len;
291  memcpy(data_, s, length_);
292  return *this;
293  }
297  EOctetString &assign(cpChar s, size_type n)
298  {
299  return assign(reinterpret_cast<cpUChar>(s), n);
300  }
304  EOctetString &assign(cpUChar data, size_type n)
305  {
306  if (capacity_ < n)
307  alloc(n);
308  length_ = n;
309  memcpy(data_, data, length_);
310  return *this;
311  }
315  EOctetString &assign(size_type n, UChar c)
316  {
317  if (capacity_ < n)
318  alloc(n);
319  length_ = n;
320  memset(data_, c, length_);
321  return *this;
322  }
326  {
327  dealloc();
328 
329  capacity_ = ostr.capacity_;
330  length_ = ostr.length_;
331  data_ = ostr.data_;
332 
333  ostr.capacity_ = 0;
334  ostr.length_ = 0;
335  ostr.data_ = nullptr;
336 
337  return *this;
338  }
339 
342  UChar &at(size_type pos)
343  {
344  if (pos > length_)
345  throw EOctetString_OutOfRange();
346  return data_[pos];
347  }
350  cUChar &at(size_type pos) const
351  {
352  if (pos > length_)
353  throw EOctetString_OutOfRange();
354  return data_[pos];
355  }
356 
358  UChar &back()
359  {
360  return data_[length_ - 1];
361  }
363  cUChar &back() const
364  {
365  return data_[length_ - 1];
366  }
367 
369  size_type capacity() const { return capacity_; }
370 
372  Void clear()
373  {
374  memset(data_, 0, length_);
375  length_ = 0;
376  }
377 
386  Int compare(const EOctetString &ostr) const
387  {
388  return compare(0, length_, ostr.data_, ostr.length_);
389  }
400  Int compare(size_type pos, size_type len, const EOctetString &ostr) const
401  {
402  return compare(pos, len, ostr.data_, ostr.length_);
403  }
416  Int compare(size_type pos, size_type len, const EOctetString &ostr, size_type subpos, size_type sublen) const
417  {
418  if (subpos >= ostr.length_)
419  throw EOctetString_OutOfRange();
420  return compare(pos, len, &ostr.data_[subpos], std::min(ostr.length_ - subpos, sublen));
421  }
430  Int compare(cpStr s) const
431  {
432  return compare(0, length_, reinterpret_cast<cpUChar>(s), strlen(s));
433  }
443  Int compare(cpUChar data, size_type n) const
444  {
445  return compare(0, length_, data, n);
446  }
457  Int compare(size_type pos, size_type len, cpStr s) const
458  {
459  return compare(pos, len, reinterpret_cast<cpUChar>(s), strlen(s));
460  }
472  Int compare(size_type pos, size_type len, cpStr s, size_type n) const
473  {
474  return compare(pos, len, reinterpret_cast<cpUChar>(s), n);
475  }
487  Int compare(size_type pos, size_type len, cpUChar data, size_type n) const
488  {
489  if (pos >= length_)
490  throw EOctetString_OutOfRange();
491 
492  len = std::min(len, length_ - pos);
493 
494  Int result = memcmp(&data_[pos], data, len);
495 
496  if (!result)
497  return len < length_ ? -1 : len > length_ ? 1 : 0;
498  return result;
499  }
500 
505  size_type copy(pUChar dst, size_type len, size_type pos = 0) const
506  {
507  if (pos >= length_)
508  throw EOctetString_OutOfRange();
509  len = std::min(length_ - pos, len);
510  memcpy(dst, &data_[pos], len);
511  return len;
512  }
513 
516  cpUChar data() const { return data_; }
519  Bool empty() const { return length_ == 0; }
520 
526  EOctetString &erase(size_type pos = 0, size_type len = npos)
527  {
528  // make sure that "pos" is in bounds
529  if (pos >= length_)
530  throw EOctetString_OutOfRange();
531 
532  // adjust length to not delete more bytes than are present
533  len = std::min(length_ - pos, len);
534 
535  // calculate the offet to start erasing and the length
536  size_type erase_start = length_ - len;
537 
538  // check for erasing x bytes from the middle
539  if (erase_start > pos)
540  {
541  size_type copy_dst = pos;
542  size_type copy_src = pos + len;
543  for (; copy_src<length_; copy_dst++, copy_src++)
544  data_[copy_dst] = data_[copy_src];
545  }
546 
547  // clear the "erased" bytes
548  std::memset(&data_[erase_start], 0, len);
549 
550  // reduce the length
551  length_ -= len;
552  return *this;
553  }
554 
558  size_type length() const { return length_; }
559  size_type size() const { return length_; }
561 
563  Void pop_back()
564  {
565  if (length_ > 0)
566  {
567  length_--;
568  data_[length_] = 0;
569  }
570  }
571 
575  Void push_back(Char c) { append(1, static_cast<UChar>(c)); }
576  Void push_back(UChar c) { append(1, c); }
578 
582  Void reserve(size_type n = 0)
583  {
584  n = std::max(n, length_);
585 
586  if (capacity_ == n)
587  return;
588 
589  pUChar oldData = data_;
590  data_ = 0;
591 
592  alloc(n);
593 
594  if (oldData)
595  {
596  memcpy(data_, oldData, length_);
597  delete [] oldData;
598  }
599  }
605  Void resize(size_type n, Char c)
606  {
607  resize(n, static_cast<UChar>(c));
608  }
609  Void resize(size_type n, UChar c = 0)
610  {
611  if (n > length_)
612  append(n - length_, c);
613  else if (n < length_)
614  {
615  memset(&data_[n], c, length_ - n);
616  length_ = n;
617  }
618  }
620 
623  {
624  reserve();
625  }
626 
628  friend std::ostream &operator<<(std::ostream &output, const EOctetString &ostr);
629 
630 private:
631  static const size_type minCapacity_ { 15 };
632 
633  Void dealloc()
634  {
635  capacity_ = 0;
636  length_ = 0;
637  if (data_)
638  {
639  delete[] data_;
640  data_ = NULL;
641  }
642  }
643  Void alloc(size_type n)
644  {
645  capacity_ = n;
646  if (data_)
647  delete[] data_;
648  if (capacity_ > 0)
649  data_ = new UChar[capacity_];
650  }
651 
652  size_type capacity_;
653  size_type length_;
654  pUChar data_;
655 };
656 
658 typedef std::vector<EOctetString> EOctetStringVec;
659 
660 inline std::ostream &operator<<(std::ostream &output, const EOctetString &ostr)
661 {
662  std::ios_base::fmtflags f(std::cout.flags());
663  for (EOctetString::size_type idx=0; idx<ostr.length(); idx++)
664  output << (idx?", ":"") << "0x" << std::hex << std::setw(2) << std::setfill('0') << static_cast<UInt>(ostr.at(idx));
665  std::cout.flags(f);
666  return output;
667 }
669 
670 namespace std
671 {
673  template <>
674  struct hash<EOctetString>
675  {
676  std::size_t operator()(const EOctetString &ostr) const noexcept
677  {
678  return EMurmurHash64::getHash(ostr.data(), ostr.length());
679  }
680  };
681 }
682 
685 
687 #ifndef LOW_NIBBLE
688 #define LOW_NIBBLE(a) (((unsigned char)a) & 0x0f)
689 #endif
690 #ifndef HIGH_NIBBLE
691 #define HIGH_NIBBLE(a) ((((unsigned char)a) & 0xf0) >> 4)
692 #endif
693 #define CHAR2TBCD(c) \
694 ( \
695  c >= '0' && c <= '9' ? c - '0' : \
696  c == '*' ? 10 : \
697  c == '#' ? 11 : \
698  (c == 'a' || c == 'A') ? 12 : \
699  (c == 'b' || c == 'B') ? 13 : \
700  (c == 'c' || c == 'C') ? 14 : 15 \
701 )
702 
706 class ETbcdString : public EOctetString
707 {
708 public:
709  //
710  // Excerpt from ITU-T Recommendation Q.825
711  //
712  // The following octets representing digits of an address encoded as a TBCD-STRING.
713  // TBCD-STRING ::= OCTETSTRING
714  // This type (Telephony Binary Coded Decimal String) is used to represent dig its from 0
715  // through 9, *, #, a, b, c, two digits per octet, each digit encoded 0000 to 1001 (0 to 9),
716  // 1010 (*) 1011(#), 1100 (a), 1101 (b) or 1110 (c); 1111 (end of pulsing signal-ST); 0000 is
717  // used as a filler when there is an odd number of digits.
718  // The most significant address signal is sent first. Subsequent address signals are sent in
719  // successive 4-bit fields.
720  //
721 
724  : EOctetString(),
725  len_(0)
726  {
727  }
730  ETbcdString(size_t len)
731  : EOctetString((len / 2) + (len % 2)),
732  len_(len)
733  {
734  }
738  : EOctetString(tbcd),
739  len_(tbcd.len_)
740  {
741  }
745  {
747  len_ = tbcd.len_;
748  return *this;
749  }
750 
754  {
755  static cpChar tbcdChars = (cpChar)"0123456789*#abc";
756 
757  EString str;
758 
759  for (size_t idx=0; idx<EOctetString::length(); idx++)
760  {
761  UChar c = (*this)[idx];
762 
763  if (tbcdChars[LOW_NIBBLE(c)])
764  {
765  str += tbcdChars[LOW_NIBBLE(c)];
766  if (tbcdChars[HIGH_NIBBLE(c)])
767  str += tbcdChars[HIGH_NIBBLE(c)];
768  }
769  }
770 
771  return str;
772  }
777  ETbcdString &fromString(const std::string &str)
778  {
779  return fromString(str.c_str());
780  }
782  {
784 
785  if (!str)
786  return *this;
787 
788  size_t idx = 0;
789 
790  while (True)
791  {
792  if (!str[idx])
793  break;
794 
795  UChar c = CHAR2TBCD(str[idx++]);
796  len_++;
797 
798  if (str[idx])
799  {
800  c |= CHAR2TBCD(str[idx++]);
801  len_++;
802  }
803  else
804  {
805  c |= 0xf0;
806  }
807  append(c);
808  }
809 
810  return *this;
811  }
813 
816  size_t length() const { return len_; }
817 
820  ETbcdString &clear() { EOctetString::clear(); len_ = 0; return *this; }
821 
822 private:
823  size_t len_;
824 };
825 
826 #endif // __EOSTRING_H
EOctetString(const EOctetString &ostr)
Copy constructor.
Definition: eostring.h:80
bool operator>=(cpStr str) const
Greater than or equal to operator.
Definition: eostring.h:178
Void push_back(UChar c)
Definition: eostring.h:576
Represents an TBCD String (Telephony Binary Coded Decimal String) as defined by ITU-T Recommendation ...
Definition: eostring.h:706
#define True
True.
Definition: ebase.h:25
Int compare(cpUChar data, size_type n) const
Compares the supplied buffer to this object.
Definition: eostring.h:443
Represents an OctetString as defined in RFC 6733.
Definition: eostring.h:33
std::size_t operator()(const EOctetString &ostr) const noexcept
Definition: eostring.h:676
Void clear()
Sets the internal buffer to all NULL&#39;s and sets the length to zero.
Definition: eostring.h:372
Bool empty() const
Returns whether this object is empty.
Definition: eostring.h:519
EOctetString & operator=(EOctetString &&ostr)
Assignment operator. Performs a move assignment.
Definition: eostring.h:120
bool operator>(cpStr str) const
Greater than operator.
Definition: eostring.h:172
Void reserve(size_type n=0)
Sets the internal buffer size to the specified value and reallocates the buffer if necessary...
Definition: eostring.h:582
DECLARE_ERROR(EOctetString_OutOfRange)
EOctetString & operator=(const EOctetString &ostr)
Assignment operator.
Definition: eostring.h:108
cUChar & operator[](size_type pos) const
Definition: eostring.h:139
Void resize(size_type n, Char c)
Resizes the buffer to the specified and fills the "new" space with the specified value.
Definition: eostring.h:605
ETbcdString(size_t len)
Class constructor.
Definition: eostring.h:730
EOctetString & assign(cpChar s, size_type n)
Assigns the specified value to this object.
Definition: eostring.h:297
STL namespace.
ETbcdString & clear()
Clears the TBCD string setting it&#39;s length to zero.
Definition: eostring.h:820
EOctetString(cpUChar data, size_type n)
Class constructor.
Definition: eostring.h:70
EOctetString(size_type n)
Class constructor.
Definition: eostring.h:49
Int compare(size_type pos, size_type len, const EOctetString &ostr) const
Compares a subset of the supplied EOctetString to this object.
Definition: eostring.h:400
size_type length() const
Returns the length of the assigned value of this object.
Definition: eostring.h:558
bool operator!=(cpStr str) const
Not equal operator.
Definition: eostring.h:166
EOctetString & assign(EOctetString &&ostr)
Assign the specified value to this object using move semantics.
Definition: eostring.h:325
EOctetString & operator=(UChar c)
Assignment operator.
Definition: eostring.h:117
bool operator<(cpStr str) const
Less than operator.
Definition: eostring.h:169
EOctetString & operator=(cpStr s)
Assignment operator.
Definition: eostring.h:111
Int compare(size_type pos, size_type len, cpStr s, size_type n) const
Compares a NULL terminated string to this object starting at the supplied offset. ...
Definition: eostring.h:472
bool operator!=(const EOctetString &ostr) const
Not equal operator.
Definition: eostring.h:147
ETbcdString & operator=(const ETbcdString &tbcd)
Assignment operator.
Definition: eostring.h:744
bool operator<(const EOctetString &ostr) const
Less than operator.
Definition: eostring.h:150
EOctetString & operator+=(Char c)
Append operator.
Definition: eostring.h:130
EOctetString & operator+=(const EOctetString &ostr)
Append operator.
Definition: eostring.h:124
bool operator<=(cpStr str) const
Less than or equal to operator.
Definition: eostring.h:175
void shrink_to_fit()
reduces the capacity of the buffer to match it&#39;s current length.
Definition: eostring.h:622
Int compare(const EOctetString &ostr) const
Compares two EOctetString objects.
Definition: eostring.h:386
bool operator==(cpStr str) const
Equality operator.
Definition: eostring.h:163
ETbcdString()
Default constructor.
Definition: eostring.h:723
EString toString() const
Converts a TBCD string to a printable string.
Definition: eostring.h:753
Void pop_back()
Removes the last byte.
Definition: eostring.h:563
bool operator<=(const EOctetString &ostr) const
Less than or equal to operator.
Definition: eostring.h:156
EOctetString(const EOctetString &ostr, size_type pos, size_type len=npos)
Class constructor. Initializes this EOctetString from a subset of another EOctetString object...
Definition: eostring.h:93
size_type size() const
Definition: eostring.h:559
size_t length() const
Returns the length of the TBCD string.
Definition: eostring.h:816
EOctetString & append(cpUChar data, size_type n)
Appends to this object.
Definition: eostring.h:227
Defines base class for exceptions and declaration helper macros.
Void push_back(Char c)
Appends the specified value to the end of the octet string.
Definition: eostring.h:575
UChar & operator[](size_type pos)
Array index operator. Returns a reference to the specified array member.
Definition: eostring.h:138
cUChar & at(size_type pos) const
Returns a constant reference to the data at the specified offset.
Definition: eostring.h:350
Hash calculation functions for strings and byte arrays.
friend std::ostream & operator<<(std::ostream &output, const EOctetString &ostr)
Insertion oeprator for serialization.
bool operator==(const EOctetString &ostr) const
Equality operator.
Definition: eostring.h:144
ETbcdString & fromString(const std::string &str)
Converts the printable string to a TBCD string.
Definition: eostring.h:777
EOctetString & append(cpStr s)
Appends to this object.
Definition: eostring.h:199
EOctetString()
Default constructor.
Definition: eostring.h:40
cUChar & back() const
Returns a constant reference to the element at the end of the buffer.
Definition: eostring.h:363
static const size_type npos
Definition: eostring.h:37
EOctetString & append(cUChar c)
Appends to this object.
Definition: eostring.h:212
Int compare(cpStr s) const
Compares the supplied NULL terminated string to this object.
Definition: eostring.h:430
EOctetString & append(const EOctetString &ostr)
Appends to this object.
Definition: eostring.h:182
EOctetString & operator=(Char c)
Assignment operator.
Definition: eostring.h:114
EOctetString & assign(const EOctetString &ostr)
Assigns the specified value to this object.
Definition: eostring.h:259
EOctetString & operator+=(cpStr s)
Append operator.
Definition: eostring.h:127
EOctetString & assign(cpStr s)
Assigns the specified value to this object.
Definition: eostring.h:285
EOctetString & append(cpStr s, size_type n)
Appends to this object.
Definition: eostring.h:206
cpUChar data() const
Returns a pointer to the internal data buffer.
Definition: eostring.h:516
bool operator>(const EOctetString &ostr) const
Greater than operator.
Definition: eostring.h:153
Int compare(size_type pos, size_type len, cpStr s) const
Compares a NULL terminated string to this object starting at the supplied offset. ...
Definition: eostring.h:457
Void resize(size_type n, UChar c=0)
Definition: eostring.h:609
size_type capacity() const
Returns the size of the currently allocated internal buffer.
Definition: eostring.h:369
Int compare(size_type pos, size_type len, cpUChar data, size_type n) const
Compares buffer to this object starting at the supplied offset.
Definition: eostring.h:487
Int compare(size_type pos, size_type len, const EOctetString &ostr, size_type subpos, size_type sublen) const
Compares a subset of the supplied EOctetString to this object.
Definition: eostring.h:416
EOctetString & operator+=(UChar c)
Append operator.
Definition: eostring.h:133
EOctetString & assign(size_type n, UChar c)
Assigns the specified value to this object.
Definition: eostring.h:315
EOctetString(cpStr s)
Class constructor.
Definition: eostring.h:58
static size_t getHash(cChar val, size_t seed=0xc70f6907UL)
Calculates a 64-bit murmur hash for the value.
Definition: ehash.h:273
bool operator>=(const EOctetString &ostr) const
Greater than or equal to operator.
Definition: eostring.h:159
UChar & at(size_type pos)
Returns a reference to the data at the specified offset.
Definition: eostring.h:342
EOctetString & assign(cpUChar data, size_type n)
Assigns the specified value to this object.
Definition: eostring.h:304
size_type copy(pUChar dst, size_type len, size_type pos=0) const
Copies data from this object to the supplied buffer.
Definition: eostring.h:505
ETbcdString & fromString(cpStr str)
Definition: eostring.h:781
String class.
Definition: estring.h:31
~EOctetString()
Class destructor.
Definition: eostring.h:101
size_t size_type
Definition: eostring.h:36
EOctetString & append(const EOctetString &ostr, size_type subpos, size_type sublen)
Appends to this object.
Definition: eostring.h:190
ETbcdString(const ETbcdString &tbcd)
Copy constructor.
Definition: eostring.h:737
EOctetString & append(size_type n, UChar c)
Appends to this object.
Definition: eostring.h:243
UChar & back()
Returns a reference to the element at the end of the buffer.
Definition: eostring.h:358
EOctetString & assign(const EOctetString &ostr, size_type subpos, size_type sublen)
Assigns the specified value to this object.
Definition: eostring.h:271
EOctetString & erase(size_type pos=0, size_type len=npos)
Erases the specified number of bytes. Supports erasing bytes from the middle of the octet string...
Definition: eostring.h:526