зеркало из https://github.com/mozilla/pjs.git
Backout my last changes, need MacOSX change, need to change inline.
This commit is contained in:
Родитель
0045c55904
Коммит
f0d38bf80d
|
@ -82,32 +82,12 @@ public:
|
||||||
NS_IMETHOD CreateRawSortKey(const nsCollationStrength strength,
|
NS_IMETHOD CreateRawSortKey(const nsCollationStrength strength,
|
||||||
const nsAString& stringIn, PRUint8* key, PRUint32 *outLen) = 0;
|
const nsAString& stringIn, PRUint8* key, PRUint32 *outLen) = 0;
|
||||||
|
|
||||||
// compare two raw sort keys
|
// compare two sort keys
|
||||||
// length is a byte length, result is same as memcmp
|
// length is a byte length, result is same as strcmp
|
||||||
// do not mix up keys with different type (i.e. raw keys and ASCII keys)
|
|
||||||
NS_IMETHOD CompareRawSortKey(const PRUint8* key1, const PRUint32 len1,
|
NS_IMETHOD CompareRawSortKey(const PRUint8* key1, const PRUint32 len1,
|
||||||
const PRUint8* key2, const PRUint32 len2,
|
const PRUint8* key2, const PRUint32 len2,
|
||||||
PRInt32* result) = 0;
|
PRInt32* result) = 0;
|
||||||
|
|
||||||
// get a length of an ASCII sort key to be generated by an input string
|
|
||||||
// length is a byte length
|
|
||||||
NS_IMETHOD GetASCIISortKeyLen(const nsCollationStrength strength,
|
|
||||||
const PRUnichar* stringIn, PRUint32* outLen) = 0;
|
|
||||||
|
|
||||||
// create a sort key from input string, the key will be encoded to ASCII string
|
|
||||||
// the generated key will not be null terminated
|
|
||||||
// length is a byte length, caller should allocate a memory for the key
|
|
||||||
//
|
|
||||||
NS_IMETHOD CreateASCIISortKey(const nsCollationStrength strength,
|
|
||||||
const PRUnichar* stringIn, char* key, PRUint32 *outLen) = 0;
|
|
||||||
|
|
||||||
// compare two ASCII sort keys
|
|
||||||
// length is a byte length, result is same as memcmp
|
|
||||||
// do not mix up keys of different types (i.e. raw keys and ASCII keys)
|
|
||||||
NS_IMETHOD CompareASCIISortKey(const char* key1, const PRUint32 len1,
|
|
||||||
const char* key2, const PRUint32 len2,
|
|
||||||
PRInt32* result) = 0;
|
|
||||||
|
|
||||||
// init this interface to a specified locale (should only be called by collation factory)
|
// init this interface to a specified locale (should only be called by collation factory)
|
||||||
//
|
//
|
||||||
NS_IMETHOD Initialize(nsILocale* locale) = 0;
|
NS_IMETHOD Initialize(nsILocale* locale) = 0;
|
||||||
|
|
|
@ -64,18 +64,6 @@ public:
|
||||||
PRInt32* result)
|
PRInt32* result)
|
||||||
{*result = mCollation->CompareRawSortKey(key1, len1, key2, len2);return NS_OK;}
|
{*result = mCollation->CompareRawSortKey(key1, len1, key2, len2);return NS_OK;}
|
||||||
|
|
||||||
NS_IMETHOD GetASCIISortKeyLen(const nsCollationStrength strength,
|
|
||||||
const PRUnichar* stringIn, PRUint32* outLen);
|
|
||||||
|
|
||||||
NS_IMETHOD CreateASCIISortKey(const nsCollationStrength strength,
|
|
||||||
const PRUnichar* stringIn, char* key, PRUint32 *outLen)
|
|
||||||
{return mCollation->CreateASCIISortKey(this, strength, stringIn, key, outLen);}
|
|
||||||
|
|
||||||
NS_IMETHOD CompareASCIISortKey(const char* key1, const PRUint32 len1,
|
|
||||||
const char* key2, const PRUint32 len2,
|
|
||||||
PRInt32* result)
|
|
||||||
{return CompareRawSortKey((PRUint8 *) key1, len1, (PRUint8 *) key2, len2, result);}
|
|
||||||
|
|
||||||
// init this interface to a specified locale (should only be called by collation factory)
|
// init this interface to a specified locale (should only be called by collation factory)
|
||||||
//
|
//
|
||||||
NS_IMETHOD Initialize(nsILocale* locale);
|
NS_IMETHOD Initialize(nsILocale* locale);
|
||||||
|
@ -86,14 +74,4 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline nsresult nsCollationMac::GetASCIISortKeyLen(const nsCollationStrength strength,
|
|
||||||
const PRUnichar* stringIn, PRUint32* outLen)
|
|
||||||
{
|
|
||||||
NS_ENSURE_ARG_POINTER(stringIn);
|
|
||||||
nsresult rv = GetSortKeyLen(strength, nsDependentString(stringIn), outLen);
|
|
||||||
if (NS_SUCCEEDED(rv))
|
|
||||||
*outLen *= 2;
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* nsCollationMac_h__ */
|
#endif /* nsCollationMac_h__ */
|
||||||
|
|
|
@ -59,18 +59,6 @@ public:
|
||||||
const PRUint8* key2, const PRUint32 len2,
|
const PRUint8* key2, const PRUint32 len2,
|
||||||
PRInt32* result)
|
PRInt32* result)
|
||||||
{*result = mCollation->CompareRawSortKey(key1, len1, key2, len2);return NS_OK;}
|
{*result = mCollation->CompareRawSortKey(key1, len1, key2, len2);return NS_OK;}
|
||||||
|
|
||||||
NS_IMETHOD GetASCIISortKeyLen(const nsCollationStrength strength,
|
|
||||||
const PRUnichar* stringIn, PRUint32* outLen);
|
|
||||||
|
|
||||||
NS_IMETHOD CreateASCIISortKey(const nsCollationStrength strength,
|
|
||||||
const PRUnichar* stringIn, char* key, PRUint32 *outLen)
|
|
||||||
{return mCollation->CreateASCIISortKey(this, strength, stringIn, key, outLen);}
|
|
||||||
|
|
||||||
NS_IMETHOD CompareASCIISortKey(const char* key1, const PRUint32 len1,
|
|
||||||
const char* key2, const PRUint32 len2,
|
|
||||||
PRInt32* result)
|
|
||||||
{return CompareRawSortKey((PRUint8 *) key1, len1, (PRUint8 *) key2, len2, result);}
|
|
||||||
|
|
||||||
// init this interface to a specified locale (should only be called by collation factory)
|
// init this interface to a specified locale (should only be called by collation factory)
|
||||||
//
|
//
|
||||||
|
@ -81,14 +69,4 @@ public:
|
||||||
virtual ~nsCollationOS2();
|
virtual ~nsCollationOS2();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline nsresult nsCollationOS2::GetASCIISortKeyLen(const nsCollationStrength strength,
|
|
||||||
const PRUnichar* stringIn, PRUint32* outLen)
|
|
||||||
{
|
|
||||||
NS_ENSURE_ARG_POINTER(stringIn);
|
|
||||||
nsresult rv = GetSortKeyLen(strength, nsDependentString(stringIn), outLen);
|
|
||||||
if (NS_SUCCEEDED(rv))
|
|
||||||
*outLen *= 2;
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* nsCollationOS2_h__ */
|
#endif /* nsCollationOS2_h__ */
|
||||||
|
|
|
@ -71,31 +71,9 @@ public:
|
||||||
PRInt32* result)
|
PRInt32* result)
|
||||||
{*result = mCollation->CompareRawSortKey(key1, len1, key2, len2);return NS_OK;}
|
{*result = mCollation->CompareRawSortKey(key1, len1, key2, len2);return NS_OK;}
|
||||||
|
|
||||||
NS_IMETHOD GetASCIISortKeyLen(const nsCollationStrength strength,
|
|
||||||
const PRUnichar* stringIn, PRUint32* outLen);
|
|
||||||
|
|
||||||
NS_IMETHOD CreateASCIISortKey(const nsCollationStrength strength,
|
|
||||||
const PRUnichar* stringIn, char* key, PRUint32 *outLen)
|
|
||||||
{return mCollation->CreateASCIISortKey(this, strength, stringIn, key, outLen);}
|
|
||||||
|
|
||||||
NS_IMETHOD CompareASCIISortKey(const char* key1, const PRUint32 len1,
|
|
||||||
const char* key2, const PRUint32 len2,
|
|
||||||
PRInt32* result)
|
|
||||||
{return CompareRawSortKey((PRUint8 *) key1, len1, (PRUint8 *) key2, len2, result);}
|
|
||||||
|
|
||||||
// init this interface to a specified locale (should only be called by collation factory)
|
// init this interface to a specified locale (should only be called by collation factory)
|
||||||
//
|
//
|
||||||
NS_IMETHOD Initialize(nsILocale* locale);
|
NS_IMETHOD Initialize(nsILocale* locale);
|
||||||
};
|
};
|
||||||
|
|
||||||
inline nsresult nsCollationUnix::GetASCIISortKeyLen(const nsCollationStrength strength,
|
|
||||||
const PRUnichar* stringIn, PRUint32* outLen)
|
|
||||||
{
|
|
||||||
NS_ENSURE_ARG_POINTER(stringIn);
|
|
||||||
nsresult rv = GetSortKeyLen(strength, nsDependentString(stringIn), outLen);
|
|
||||||
if (NS_SUCCEEDED(rv))
|
|
||||||
*outLen *= 2;
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* nsCollationUnix_h__ */
|
#endif /* nsCollationUnix_h__ */
|
||||||
|
|
|
@ -63,18 +63,6 @@ public:
|
||||||
PRInt32* result)
|
PRInt32* result)
|
||||||
{*result = mCollation->CompareRawSortKey(key1, len1, key2, len2);return NS_OK;}
|
{*result = mCollation->CompareRawSortKey(key1, len1, key2, len2);return NS_OK;}
|
||||||
|
|
||||||
NS_IMETHOD GetASCIISortKeyLen(const nsCollationStrength strength,
|
|
||||||
const PRUnichar* stringIn, PRUint32* outLen);
|
|
||||||
|
|
||||||
NS_IMETHOD CreateASCIISortKey(const nsCollationStrength strength,
|
|
||||||
const PRUnichar* stringIn, char* key, PRUint32 *outLen)
|
|
||||||
{return mCollation->CreateASCIISortKey(this, strength, stringIn, key, outLen);}
|
|
||||||
|
|
||||||
NS_IMETHOD CompareASCIISortKey(const char* key1, const PRUint32 len1,
|
|
||||||
const char* key2, const PRUint32 len2,
|
|
||||||
PRInt32* result)
|
|
||||||
{return CompareRawSortKey((PRUint8 *) key1, len1, (PRUint8 *) key2, len2, result);}
|
|
||||||
|
|
||||||
// init this interface to a specified locale (should only be called by collation factory)
|
// init this interface to a specified locale (should only be called by collation factory)
|
||||||
//
|
//
|
||||||
NS_IMETHOD Initialize(nsILocale* locale);
|
NS_IMETHOD Initialize(nsILocale* locale);
|
||||||
|
@ -85,15 +73,4 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline nsresult nsCollationWin::GetASCIISortKeyLen(const nsCollationStrength strength,
|
|
||||||
const PRUnichar* stringIn, PRUint32* outLen)
|
|
||||||
{
|
|
||||||
NS_ENSURE_ARG_POINTER(stringIn);
|
|
||||||
nsresult rv = GetSortKeyLen(strength, nsDependentString(stringIn), outLen);
|
|
||||||
if (NS_SUCCEEDED(rv))
|
|
||||||
*outLen *= 2;
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* nsCollationWin_h__ */
|
#endif /* nsCollationWin_h__ */
|
||||||
|
|
Загрузка…
Ссылка в новой задаче