mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
move UTF8traits to the public realm for later consumption
r=dbaron r=jag (the string experts) for bug 110531
This commit is contained in:
parent
b8248f53a0
commit
64bbae7daf
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user