зеркало из https://github.com/mozilla/pjs.git
move UTF8traits to the public realm for later consumption
r=dbaron r=jag (the string experts) for bug 110531
This commit is contained in:
Родитель
39bde9b767
Коммит
0c69f6d840
|
@ -1519,18 +1519,6 @@ NS_ConvertASCIItoUCS2::NS_ConvertASCIItoUCS2( const nsACString& aCString )
|
|||
}
|
||||
}
|
||||
|
||||
class UTF8traits
|
||||
{
|
||||
public:
|
||||
static PRBool isASCII(char c) { return (c & 0x80) == 0x00; }
|
||||
static PRBool isInSeq(char c) { return (c & 0xC0) == 0x80; }
|
||||
static PRBool is2byte(char c) { return (c & 0xE0) == 0xC0; }
|
||||
static PRBool is3byte(char c) { return (c & 0xF0) == 0xE0; }
|
||||
static PRBool is4byte(char c) { return (c & 0xF8) == 0xF0; }
|
||||
static PRBool is5byte(char c) { return (c & 0xFC) == 0xF8; }
|
||||
static PRBool is6byte(char c) { return (c & 0xFE) == 0xFC; }
|
||||
};
|
||||
|
||||
class CalculateUTF8Length
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -72,6 +72,18 @@
|
|||
#endif
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
class UTF8traits
|
||||
{
|
||||
public:
|
||||
static PRBool isASCII(char c) { return (c & 0x80) == 0x00; }
|
||||
static PRBool isInSeq(char c) { return (c & 0xC0) == 0x80; }
|
||||
static PRBool is2byte(char c) { return (c & 0xE0) == 0xC0; }
|
||||
static PRBool is3byte(char c) { return (c & 0xF0) == 0xE0; }
|
||||
static PRBool is4byte(char c) { return (c & 0xF8) == 0xF0; }
|
||||
static PRBool is5byte(char c) { return (c & 0xFC) == 0xF8; }
|
||||
static PRBool is6byte(char c) { return (c & 0xFE) == 0xFC; }
|
||||
};
|
||||
|
||||
#ifdef STANDALONE_MI_STRING_TESTS
|
||||
class nsAFlatString { public: virtual ~nsAString() { } };
|
||||
#endif
|
||||
|
|
|
@ -1519,18 +1519,6 @@ NS_ConvertASCIItoUCS2::NS_ConvertASCIItoUCS2( const nsACString& aCString )
|
|||
}
|
||||
}
|
||||
|
||||
class UTF8traits
|
||||
{
|
||||
public:
|
||||
static PRBool isASCII(char c) { return (c & 0x80) == 0x00; }
|
||||
static PRBool isInSeq(char c) { return (c & 0xC0) == 0x80; }
|
||||
static PRBool is2byte(char c) { return (c & 0xE0) == 0xC0; }
|
||||
static PRBool is3byte(char c) { return (c & 0xF0) == 0xE0; }
|
||||
static PRBool is4byte(char c) { return (c & 0xF8) == 0xF0; }
|
||||
static PRBool is5byte(char c) { return (c & 0xFC) == 0xF8; }
|
||||
static PRBool is6byte(char c) { return (c & 0xFE) == 0xFC; }
|
||||
};
|
||||
|
||||
class CalculateUTF8Length
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -72,6 +72,18 @@
|
|||
#endif
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
class UTF8traits
|
||||
{
|
||||
public:
|
||||
static PRBool isASCII(char c) { return (c & 0x80) == 0x00; }
|
||||
static PRBool isInSeq(char c) { return (c & 0xC0) == 0x80; }
|
||||
static PRBool is2byte(char c) { return (c & 0xE0) == 0xC0; }
|
||||
static PRBool is3byte(char c) { return (c & 0xF0) == 0xE0; }
|
||||
static PRBool is4byte(char c) { return (c & 0xF8) == 0xF0; }
|
||||
static PRBool is5byte(char c) { return (c & 0xFC) == 0xF8; }
|
||||
static PRBool is6byte(char c) { return (c & 0xFE) == 0xFC; }
|
||||
};
|
||||
|
||||
#ifdef STANDALONE_MI_STRING_TESTS
|
||||
class nsAFlatString { public: virtual ~nsAString() { } };
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче