GetSortKey() public method

public GetSortKey ( String source ) : SortKey
source String
return SortKey
Ejemplo n.º 1
0
	void AssertSortKey (string message, byte [] expected, string test, CompareOptions opt, CompareInfo ci)
	{
		byte [] actual = ci.GetSortKey (test, opt).KeyData;
		Assert.AreEqual (expected, actual, message);
	}
Ejemplo n.º 2
0
        public static Key Fixed(string data, int length, CompareInfo collation, CompareOptions collationOptions, Direction direction = Direction.Ascending)
        {
            Key i;
            var tmp = collation.GetSortKey(data, collationOptions).KeyData;

            if (direction == Direction.Descending)
                InvertBits(tmp);

            i.bytes = tmp;
            i.length = length * 6; // Assumes 2 bytes per character is enough, may not be true for all UTF-16 characters
            return i;
        }