ADi-FontEngine  1.0
PDF Optimized FontEngine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FontEngineTCode.h
Go to the documentation of this file.
1 // FontEngine/FontEngineTCode.h
2 //
3 // Copyright 2012 - Andreas Dippe
4 //
5 // This file is part of ADi-FontEngine, 2012
6 //-----------------------------------------------------------------------------
7 
8 #ifndef _FONTENGINETCODE_H_
9 #define _FONTENGINETCODE_H_
10 
12 
13 #include <string>
14 #include <vector>
15 #include <cmath>
16 #include <iostream>
17 #include <iomanip>
18 
19 #if defined( unix ) || defined(_AIX)
20 # include <cstring> // memcpy()
21 # include <cstdlib> // malloc()
22 #endif // defined( unix ) || defined(_AIX)
23 
24 namespace FontEngine
25 {
26 
27  //-----------------------------------------------------------------------------
28  //-----------------------------------------------------------------------------
29  /*! \brief template class to keep small memory objects
30  \param t_bufSize the minimal byte size of internal byte buffer
31  */
32  template< int t_bufSize = sizeof( unsigned char*) >
33  struct TCode
34  {
35 # ifdef WIN32
36  typedef unsigned __int64 TCodeUInt64;
37  typedef __int64 TCodeInt64;
38 # elif defined( __GNUC__ )
39  typedef unsigned long long TCodeUInt64;
40  typedef long long TCodeInt64;
41 # else // WIN32
42 # error (define_own_types_here)
43 # endif // WIN32
44  //-----------------------------------------------------------------------------
45  typedef std::pair< const unsigned char*, unsigned int > TCodeData;
46  typedef unsigned short TUNiValue;
47  typedef std::vector< TUNiValue > TUNiData;
48  typedef TCodeUInt64 TLiteral64;
49  typedef TCodeInt64 TDiff;
50  typedef std::basic_string<unsigned char> TTempBuf;
51  typedef unsigned int size_type;
52  //-----------------------------------------------------------------------------
53  //-----------------------------------------------------------------------------
54  /*! \brief default ctor
55  */
57  : _len( 0)
58  , _hbuf( NULL)
59  {}
60  //-----------------------------------------------------------------------------
61  /*! \brief copy ctor
62  \param tvc obj to copy
63  */
64  TCode( const TCode & tvc)
65  : _len( 0)
66  , _hbuf( NULL)
67  {
68  set( (t_bufSize < tvc._len) ? tvc._hbuf : tvc._lbuf, tvc._len);
69  }
70  //-----------------------------------------------------------------------------
71  /*! \brief ctor to create an object from unsigned char buffer
72  \param data the memory buffer to copy
73  \param len length of the buffer in byte
74  */
75  TCode( const unsigned char* data, unsigned int len)
76  : _len( 0)
77  , _hbuf( NULL)
78  {
79  set( data, len);
80  }
81  //-----------------------------------------------------------------------------
82  /*! \brief ctor to create an object from std::string
83  \param data the std::string buffer
84  */
85  explicit TCode( const std::string & data)
86  : _len( 0)
87  , _hbuf( NULL)
88  {
89  set( reinterpret_cast< const unsigned char*>( data.c_str()), data.size());
90  }
91  //-----------------------------------------------------------------------------
92  /*! \brief ctor to create an object from TUNiValue (should be used to keep Unicodes)
93  Unicodes are often used as two byte objects, like U+0041
94  \param us the TUNiValue
95  \param is_byte if this is true this object has byte size of 1, the default create a TCode object with byte size of 2
96  */
97  explicit TCode( TUNiValue us, bool is_byte = false)
98  : _len( 0)
99  , _hbuf( NULL)
100  {
101  if( is_byte) {
102  const unsigned char data( static_cast<unsigned char>( us));
103 
104  set( &data, 1);
105  } else
106  set( 1, &us);
107  }
108  //-----------------------------------------------------------------------------
109  /*! \brief ctor to create an object from pointer of TUNiValue
110  \param num_short the number of TUNiValue values or size of us array
111  \param us the TUNiValue buffer
112  */
113  TCode( unsigned int num_short, const TUNiValue* us)
114  : _len( 0)
115  , _hbuf( NULL)
116  {
117  set( num_short, us);
118  }
119  //-----------------------------------------------------------------------------
120  /*! \brief ctor to create an object from 64 bit integer
121  \param lit the 64 bit integer
122  \param len the number of bytes used as byte size
123  */
124  TCode( TLiteral64 lit, unsigned int len)
125  : _len( 0)
126  , _hbuf( NULL)
127  {
128  _len = std::max( len, ((0 < lit) ? (static_cast<unsigned int>( std::log( double( lit)) / std::log( 2.0) / 8.0 + 1)) : 0));
129  unsigned char* buf = (t_bufSize < _len) ? (_hbuf = static_cast<unsigned char*>( std::malloc( _len))) : _lbuf;
130 
131  for( unsigned int i = _len; 0 != i--; ) {
132  buf[i] = static_cast<unsigned char>( lit);
133  lit >>= 8;
134  }
135  }
136  //-----------------------------------------------------------------------------
137  /*! \brief dtor
138  */
140  {
141  clear();
142  }
143  //-----------------------------------------------------------------------------
144  /*! \brief assignmment operator
145  \param tvc obj to copy
146  \return this
147  */
148  TCode & operator=( const TCode & tvc)
149  {
150  set( (t_bufSize < tvc._len) ? tvc._hbuf : tvc._lbuf, tvc._len);
151  return *this;
152  }
153  //-----------------------------------------------------------------------------
154  /*! \brief function to set the object buffer from std::string
155  \param data the std::string buffer
156  */
157  void set( const std::string & data)
158  {
159  set( reinterpret_cast< const unsigned char*>( data.c_str()), data.size());
160  }
161  //-----------------------------------------------------------------------------
162  /*! \brief function to set the object buffer from unsigned char buffer
163  \param data the memory buffer to copy
164  \param len length of the buffer in byte
165  */
166  void set( const unsigned char* data, unsigned int len)
167  {
168  clear();
169  _len = len;
170  if( t_bufSize < _len) {
171  _hbuf = static_cast<unsigned char*>( std::malloc( _len));
172  std::memcpy( _hbuf, data, _len);
173  } else
174  std::memcpy( _lbuf, data, _len);
175  }
176  //-----------------------------------------------------------------------------
177  /*! \brief function to set the object from pointer of TUNiValue
178  \param num_short the number of TUNiValue values or size of us array
179  \param us the TUNiValue buffer
180  */
181  void set( unsigned int num_short, const TUNiValue* us)
182  {
183  clear();
184  _len = num_short * 2;
185  unsigned char* buf = (t_bufSize < _len) ? (_hbuf = static_cast<unsigned char*>( std::malloc( _len))) : _lbuf;
186 
187  for( unsigned int i = 0, j = 0; i < num_short; ++i, ++j) {
188  buf[j] = static_cast<unsigned char>( us[i] >> 8);
189  buf[++j] = static_cast<unsigned char>( us[i]);
190  }
191  }
192  //-----------------------------------------------------------------------------
193  /*! \brief reset this and clear the buffer
194  */
195  void clear()
196  {
197  if( t_bufSize < _len)
198  std::free( _hbuf);
199  _hbuf = NULL;
200  _len = 0;
201  }
202  //-----------------------------------------------------------------------------
203  /*! \brief return the empty buffer state
204  \return true if the buffer is empty
205  */
206  bool empty() const
207  {
208  return (0 == _len);
209  }
210  //-----------------------------------------------------------------------------
211  /*! \brief return the size of buffer in byte
212  \return the buffer byte size
213  */
214  size_type size() const
215  {
216  return _len;
217  }
218  //-----------------------------------------------------------------------------
219  /*! \brief return the size of buffer in unsigned short
220  \return the buffer unsigned short size
221  */
223  {
224  return (_len + 1) / 2;
225  }
226  //-----------------------------------------------------------------------------
227  /*! \brief typecast function return the buffer as TCodeData
228  \return a TCodeData from buffer
229  */
230  operator TCodeData() const
231  {
232  return TCodeData( getbuf(), _len);
233  }
234  //-----------------------------------------------------------------------------
235  /*! \brief typecast function return the buffer as std::string copy
236  \return a std::string from buffer
237  */
238  operator std::string() const
239  {
240  return std::string( reinterpret_cast<const char*>( getbuf()), _len);
241  }
242  //-----------------------------------------------------------------------------
243  /*! \brief function return a single unicode (2 bytes), size() shall return be 1 or 2
244  \return single unicode (2 bytes) from buffer
245  */
247  {
248  FontEngine_Assert( (1 == _len) || (2 == _len));
249  const unsigned char* buf = getbuf();
250 
251  if( 1 == _len) {
252  return *buf;
253  } else if( 1 < _len) {
254  return ((buf[0] << 8) | buf[1]);
255  }
256  return 0;
257  }
258  //-----------------------------------------------------------------------------
259  /*! \brief typecast function return the buffer as unicode vector
260  \return the buffer as unicode vector
261  */
262  operator TUNiData() const
263  {
264  TUNiData ret;
265  const unsigned char* buf = getbuf();
266 
267  if( 1 == _len) {
268  ret.push_back( *buf);
269  } else {
270  for( unsigned int i = 0; i+1 < _len; i += 2)
271  ret.push_back( (buf[i] << 8) | buf[i+1]);
272  }
273  return ret;
274  }
275  //-----------------------------------------------------------------------------
276  /*! \brief calculate the difference between this and another object. The code size must be smaller than 8 byte (64 bit)
277  \param tvc object to subtraction from this
278  \return the difference
279  */
280  TDiff operator-( const TCode & tvc) const
281  {
282  return getliteral() - tvc.getliteral();
283  }
284  //-----------------------------------------------------------------------------
285  /*! \brief add 8 byte (64 bit) number literal to this.
286  \param diff object to add to this
287  \return the sum of this and parameter diff
288  */
289  TCode operator+( TDiff diff) const
290  {
291  if( sizeof( TLiteral64) > size())
292  return TCode( getliteral() + diff, _len);
293  TTempBuf newbuf( 1, 0);
294 
295  newbuf.append( getbuf(), size());
296  for( TTempBuf::size_type i = newbuf.size(); 0 != i--; ) {
297  if( 0 != ++newbuf[i])
298  break;
299  }
300  return (0 != newbuf[0]) ? TCode( &newbuf[0], newbuf.size()) : TCode( &newbuf[1], size());
301  }
302  //-----------------------------------------------------------------------------
303  /*! \brief prefix increment operator, increment 1 to this
304  \return const this
305  */
306  const TCode & operator++()
307  {
308  unsigned int i( _len);
309  unsigned char* buf = getbuf();
310 
311  while( (0 != i--) && ('\0' == ++(buf[i])));
312  if( static_cast<unsigned int>( -1) == i) {
313  if( t_bufSize < _len)
314  std::free( _hbuf);
315  if( t_bufSize < ++_len) {
316  _hbuf = static_cast<unsigned char*>( std::malloc( _len));
317  std::memset( _hbuf, 0, _len);
318  _hbuf[0] = 1;
319  } else {
320  std::memset( _lbuf, 0, _len);
321  _lbuf[0] = 1;
322  }
323  }
324  return *this;
325  }
326  //-----------------------------------------------------------------------------
327  /*! \brief lesser operator
328  \param tc the comparison object
329  \return true if this is lesser than tc
330  */
331  bool operator<( const TCode & tc) const
332  {
333  if( _len != tc._len)
334  return _len < tc._len;
335  const unsigned char* buf = getbuf();
336  const unsigned char* tcbuf = tc.getbuf();
337 
338  for( unsigned int i = 0; i < _len; ++i) {
339  if( buf[i] != tcbuf[i])
340  return buf[i] < tcbuf[i];
341  }
342  return false;
343  }
344  //-----------------------------------------------------------------------------
345  /*! \brief equal operator
346  \param tc the comparison object
347  \return true if this is equal to tc
348  */
349  bool operator==( const TCode & tc) const
350  {
351  return (_len == tc._len) && (0 == std::memcmp( getbuf(), tc.getbuf(), _len));
352  }
353  //-----------------------------------------------------------------------------
354  /*! \brief unequal operator
355  \param tc the comparison object
356  \return true if this is unequal to tc
357  */
358  bool operator!=( const TCode & tc) const
359  {
360  return !operator==( tc);
361  }
362  //-----------------------------------------------------------------------------
363  /*! \brief lesser equal operator
364  \param tc the comparison object
365  \return true if this is lesser than or equal tc
366  */
367  bool operator<=( const TCode & tc) const
368  {
369  return operator==( tc) || operator<( tc);
370  }
371  //-----------------------------------------------------------------------------
372  /*! \brief greater equal operator
373  \param tc the comparison object
374  \return true if this is greater than or equal tc
375  */
376  bool operator>=( const TCode & tc) const
377  {
378  return !operator<( tc);
379  }
380  //-----------------------------------------------------------------------------
381  /*! \brief greater operator
382  \param tc the comparison object
383  \return true if this is greater than or tc
384  */
385  bool operator>( const TCode & tc) const
386  {
387  return !operator<=( tc);
388  }
389  //-----------------------------------------------------------------------------
390  /*! \brief convert internal buffer into 64 bit number
391  \return 64 bit number from this
392  */
394  {
395  TLiteral64 ret( 0);
396  const unsigned char* buf = getbuf();
397 
398  for( unsigned int i = 0; i < _len; ++i)
399  ret = (ret << 8) | buf[i];
400  return ret;
401  }
402  //-----------------------------------------------------------------------------
403  private:
404  /*! \brief get internal const buffer
405  \return const buffer
406  */
407  const unsigned char* getbuf() const
408  {
409  return (t_bufSize < _len) ? _hbuf : _lbuf;
410  }
411  //-----------------------------------------------------------------------------
412  /*! \brief get internal buffer
413  \return buffer
414  */
415  unsigned char* getbuf()
416  {
417  return (t_bufSize < _len) ? _hbuf : _lbuf;
418  }
419  //-----------------------------------------------------------------------------
420  private:
421  unsigned int _len; //!< the length of buffer in byte
422  union {
423  unsigned char* _hbuf; //!< keep heap buffer if size is greater than t_bufSize
424  unsigned char _lbuf[t_bufSize]; //!< keep local buffer if size is lesser or equal to t_bufSize
425  };
426  };
427  //-----------------------------------------------------------------------------
428  //-----------------------------------------------------------------------------
429  //
430  //-----------------------------------------------------------------------------
431  template< typename T >
432  struct TRange
433  {
434  typedef T value_type;
435  //-----------------------------------------------------------------------------
437  : _lo()
438  , _up()
439  {}
440  //-----------------------------------------------------------------------------
441  TRange( const value_type & tc)
442  : _lo( tc)
443  , _up( tc)
444  {}
445  //-----------------------------------------------------------------------------
446  TRange( const value_type & lotc, const value_type & uptc)
447  : _lo( lotc)
448  , _up( uptc)
449  {
451  }
452  //-----------------------------------------------------------------------------
453  bool operator==( const TRange & tc) const
454  {
455  return (_lo == tc._lo) && (_up == tc._up);
456  }
457  //-----------------------------------------------------------------------------
458  bool operator<( const TRange & tc) const
459  {
460  return (_lo < tc._lo) && (_up < tc._up);
461  }
462  //-----------------------------------------------------------------------------
463 // void rangeCheckCMap( const value_type & cc)
464 // {
465 // _lo.rangeMinCheckCMap( cc);
466 // _up.rangeMaxCheckCMap( cc);
467 // }
468 // //-----------------------------------------------------------------------------
471  };
472  //-----------------------------------------------------------------------------
473  template<>
475  : _lo( 0)
476  , _up( 0)
477  {}
478  //-----------------------------------------------------------------------------
479  template<>
481  : _lo( 0)
482  , _up( 0)
483  {}
484  //-----------------------------------------------------------------------------
486  {
487  bool operator()( const TCode<>::TCodeData & uc1, const TCode<>::TCodeData & uc2) const
488  {
489  for( unsigned int i = 0; (i < uc1.second) && (i < uc2.second); i += 2) {
490  unsigned int u1( (uc1.first[i] << 8) | ((i+1 == uc1.second) ? 0 : uc1.first[i+1]));
491  unsigned int u2( (uc2.first[i] << 8) | ((i+1 == uc2.second) ? 0 : uc2.first[i+1]));
492 
493  if( u1 != u2)
494  return (u1 < u2);
495  }
496  return (uc1.second < uc2.second);
497  }
498  };
499  //-----------------------------------------------------------------------------
501  {
502  bool operator()( const TRange< TCode<> > & uc1, const TRange< TCode<> > & uc2) const
503  {
504  FontEngine_Assert( (uc1._lo.size() == uc1._up.size()) && (uc2._lo.size() == uc2._up.size()));
505  if( uc1._lo.size() == uc2._lo.size())
506  return TUNiDataEval()( uc1._lo, uc2._lo) && TUNiDataEval()( uc1._up, uc2._up);
507  return uc1._lo.size() < uc2._lo.size();
508  }
509  };
510  //-----------------------------------------------------------------------------
511  template< typename PT = char >
512  struct TUNiDataOut
513  {
514  TUNiDataOut( const TCode<>::TCodeData & uc, const PT* sep = NULL, const PT* sep1 = NULL)
515  : _uc( uc)
516  , _sep( sep)
517  , _sep1( sep1)
518  {}
519  //-----------------------------------------------------------------------------
520  inline char hexcout( unsigned char c) const
521  {
522  return c + ((9 < c) ? ('A' - 10) : '0');
523  }
524  //-----------------------------------------------------------------------------
525  inline void unicodeout( std::ostream & out, unsigned int i) const
526  {
527  out.put( (i < _uc.second) ? hexcout( (_uc.first[i] >> 4) & 0x0f) : '0');
528  out.put( (i < _uc.second) ? hexcout( _uc.first[i] & 0x0f) : '0');
529  out.put( (++i < _uc.second) ? hexcout( (_uc.first[i] >> 4) & 0x0f) : '0');
530  out.put( (i < _uc.second) ? hexcout( _uc.first[i] & 0x0f) : '0');
531  }
532  //-----------------------------------------------------------------------------
533  inline wchar_t hexwcout( unsigned char c) const
534  {
535  return c + ((9 < c) ? (L'A' - 10) : L'0');
536  }
537  //-----------------------------------------------------------------------------
538  inline void unicodewout( std::wostream & out, unsigned int i) const
539  {
540  out.put( (i < _uc.second) ? hexwcout( (_uc.first[i] >> 4) & 0x0f) : L'0');
541  out.put( (i < _uc.second) ? hexwcout( _uc.first[i] & 0x0f) : L'0');
542  out.put( (++i < _uc.second) ? hexwcout( (_uc.first[i] >> 4) & 0x0f) : L'0');
543  out.put( (i < _uc.second) ? hexwcout( _uc.first[i] & 0x0f) : L'0');
544  }
545  //-----------------------------------------------------------------------------
547  const PT* _sep;
548  const PT* _sep1;
549  };
550  //-----------------------------------------------------------------------------
551  inline std::ostream & operator<<( std::ostream & out, const TUNiDataOut<char> & unid)
552  {
553  if( NULL != unid._sep1)
554  out << unid._sep1;
555  if( (0 == unid._uc.second) || (NULL == unid._uc.first)) {
556  out << "0000";
557  } else {
558  for( unsigned int i = 0; i < unid._uc.second; i += 2) {
559  if( (0 < i) && (NULL != unid._sep))
560  out << unid._sep;
561  unid.unicodeout( out, i);
562  }
563  }
564  return out;
565  }
566  //-----------------------------------------------------------------------------
567  inline std::wostream & operator<<( std::wostream & out, const TUNiDataOut<wchar_t> & unid)
568  {
569  if( NULL != unid._sep1)
570  out << unid._sep1;
571  if( (0 == unid._uc.second) || (NULL == unid._uc.first)) {
572  out << L"0000";
573  } else {
574  for( unsigned int i = 0; i < unid._uc.second; i += 2) {
575  if( (0 < i) && (NULL != unid._sep))
576  out << unid._sep;
577  unid.unicodewout( out, i);
578  }
579  }
580  return out;
581  }
582  //-----------------------------------------------------------------------------
583 
584 } // FontEngine namespace
585 //-----------------------------------------------------------------------------
586 
587 #endif // _FONTENGINETCODE_H_
588 //-----------------------------------------------------------------------------
589 /*!\history
590 ** ADi-2012-12-14: creation
591 ** ADi-2012-12-18: define unix types
592 ** HTh-2013-01-07: added missing typedefs for unix
593 ** ADi-2013-01-25: add specialisation in struct TRange to improve construction
594 ** RGu-2013-01-25: added missing template<> for specialization of struct TRange
595 ** RGu-2013-01-28: added missing inline to avoid linker errors
596 ** ADi-2013-04-23: bugfix TUNiDataRangeEval::operator()(..) regard size of ranges also
597 ** ADi-2013-06-25: bugfix ctor TCode(..) must check unicode value before calculate std::log(..)
598 ** ADi-2013-06-27: Solaris compiler dont like underscore in front of an template parameter
599 ** ADi-2013-11-18: correct doxygen comments
600 */
bool operator<(const TCode &tc) const
lesser operator
Definition: FontEngineTCode.h:331
unsigned short TUNiValue
Definition: FontEngineTCode.h:46
unsigned char * _hbuf
keep heap buffer if size is greater than t_bufSize
Definition: FontEngineTCode.h:423
bool operator>=(const TCode &tc) const
greater equal operator
Definition: FontEngineTCode.h:376
bool operator==(const TCode &tc) const
equal operator
Definition: FontEngineTCode.h:349
TLiteral64 getliteral() const
convert internal buffer into 64 bit number
Definition: FontEngineTCode.h:393
TCode & operator=(const TCode &tvc)
assignmment operator
Definition: FontEngineTCode.h:148
TRange(const value_type &tc)
Definition: FontEngineTCode.h:441
void set(unsigned int num_short, const TUNiValue *us)
function to set the object from pointer of TUNiValue
Definition: FontEngineTCode.h:181
TRange(const value_type &lotc, const value_type &uptc)
Definition: FontEngineTCode.h:446
void clear()
reset this and clear the buffer
Definition: FontEngineTCode.h:195
value_type _up
Definition: FontEngineTCode.h:470
size_type sizeUNi() const
return the size of buffer in unsigned short
Definition: FontEngineTCode.h:222
TCode operator+(TDiff diff) const
add 8 byte (64 bit) number literal to this.
Definition: FontEngineTCode.h:289
bool operator()(const TCode<>::TCodeData &uc1, const TCode<>::TCodeData &uc2) const
Definition: FontEngineTCode.h:487
TUNiValue getUShort() const
function return a single unicode (2 bytes), size() shall return be 1 or 2
Definition: FontEngineTCode.h:246
unsigned int size_type
Definition: FontEngineTCode.h:51
TCode(const std::string &data)
ctor to create an object from std::string
Definition: FontEngineTCode.h:85
TCodeInt64 TDiff
Definition: FontEngineTCode.h:49
size_type size() const
return the size of buffer in byte
Definition: FontEngineTCode.h:214
TCode(TLiteral64 lit, unsigned int len)
ctor to create an object from 64 bit integer
Definition: FontEngineTCode.h:124
void unicodewout(std::wostream &out, unsigned int i) const
Definition: FontEngineTCode.h:538
bool empty() const
return the empty buffer state
Definition: FontEngineTCode.h:206
unsigned char _lbuf[t_bufSize]
keep local buffer if size is lesser or equal to t_bufSize
Definition: FontEngineTCode.h:424
TRange()
Definition: FontEngineTCode.h:436
Definition: FontEngineTCode.h:485
wchar_t hexwcout(unsigned char c) const
Definition: FontEngineTCode.h:533
TCode(TUNiValue us, bool is_byte=false)
ctor to create an object from TUNiValue (should be used to keep Unicodes) Unicodes are often used as ...
Definition: FontEngineTCode.h:97
void unicodeout(std::ostream &out, unsigned int i) const
Definition: FontEngineTCode.h:525
bool operator>(const TCode &tc) const
greater operator
Definition: FontEngineTCode.h:385
bool operator==(const TRange &tc) const
Definition: FontEngineTCode.h:453
template class to keep small memory objects
Definition: FontEngineTCode.h:33
Definition: FontEngineTCode.h:432
std::vector< TUNiValue > TUNiData
Definition: FontEngineTCode.h:47
bool operator()(const TRange< TCode<> > &uc1, const TRange< TCode<> > &uc2) const
Definition: FontEngineTCode.h:502
TCode(const unsigned char *data, unsigned int len)
ctor to create an object from unsigned char buffer
Definition: FontEngineTCode.h:75
~TCode()
dtor
Definition: FontEngineTCode.h:139
TCode(const TCode &tvc)
copy ctor
Definition: FontEngineTCode.h:64
Definition: FontEngineTCode.h:500
void set(const std::string &data)
function to set the object buffer from std::string
Definition: FontEngineTCode.h:157
void FontEngine_Assert(bool expr)
function to check program process no excption raise
Definition: FontEngineError.h:200
TCode()
default ctor
Definition: FontEngineTCode.h:56
std::basic_string< unsigned char > TTempBuf
Definition: FontEngineTCode.h:50
TCode(unsigned int num_short, const TUNiValue *us)
ctor to create an object from pointer of TUNiValue
Definition: FontEngineTCode.h:113
const PT * _sep
Definition: FontEngineTCode.h:547
T value_type
Definition: FontEngineTCode.h:434
const TCode & operator++()
prefix increment operator, increment 1 to this
Definition: FontEngineTCode.h:306
bool operator!=(const TCode &tc) const
unequal operator
Definition: FontEngineTCode.h:358
TDiff operator-(const TCode &tvc) const
calculate the difference between this and another object. The code size must be smaller than 8 byte (...
Definition: FontEngineTCode.h:280
const PT * _sep1
Definition: FontEngineTCode.h:548
std::pair< const unsigned char *, unsigned int > TCodeData
Definition: FontEngineTCode.h:45
Definition: FontEngineTCode.h:512
void set(const unsigned char *data, unsigned int len)
function to set the object buffer from unsigned char buffer
Definition: FontEngineTCode.h:166
TCodeUInt64 TLiteral64
Definition: FontEngineTCode.h:48
char hexcout(unsigned char c) const
Definition: FontEngineTCode.h:520
const TCode::TCodeData & _uc
Definition: FontEngineTCode.h:546
value_type _lo
Definition: FontEngineTCode.h:469
bool operator<=(const TCode &tc) const
lesser equal operator
Definition: FontEngineTCode.h:367
bool operator<(const TRange &tc) const
Definition: FontEngineTCode.h:458
TUNiDataOut(const TCode<>::TCodeData &uc, const PT *sep=NULL, const PT *sep1=NULL)
Definition: FontEngineTCode.h:514
InsideFont and ADI-FontEngine : Andreas Dippe, © 2013
http://www.insidefont.de