src/corelib/tools/qchar.h
changeset 30 5dc02b23752f
parent 18 2f34d5167611
child 33 3e2da88830cd
equal deleted inserted replaced
29:b72c6db6890b 30:5dc02b23752f
   283     inline uchar cell() const { return uchar(ucs & 0xff); }
   283     inline uchar cell() const { return uchar(ucs & 0xff); }
   284     inline uchar row() const { return uchar((ucs>>8)&0xff); }
   284     inline uchar row() const { return uchar((ucs>>8)&0xff); }
   285     inline void setCell(uchar cell);
   285     inline void setCell(uchar cell);
   286     inline void setRow(uchar row);
   286     inline void setRow(uchar row);
   287 
   287 
       
   288     static inline bool isHighSurrogate(uint ucs4) {
       
   289         return ((ucs4 & 0xfffffc00) == 0xd800);
       
   290     }
       
   291     static inline bool isLowSurrogate(uint ucs4) {
       
   292         return ((ucs4 & 0xfffffc00) == 0xdc00);
       
   293     }
       
   294     static inline bool requiresSurrogates(uint ucs4) {
       
   295         return (ucs4 >= 0x10000);
       
   296     }
   288     static inline uint surrogateToUcs4(ushort high, ushort low) {
   297     static inline uint surrogateToUcs4(ushort high, ushort low) {
   289         return (uint(high)<<10) + low - 0x35fdc00;
   298         return (uint(high)<<10) + low - 0x35fdc00;
   290     }
   299     }
   291     static inline uint surrogateToUcs4(QChar high, QChar low) {
   300     static inline uint surrogateToUcs4(QChar high, QChar low) {
   292         return (uint(high.ucs)<<10) + low.ucs - 0x35fdc00;
   301         return (uint(high.ucs)<<10) + low.ucs - 0x35fdc00;