Exemple #1
0
        private static int Compare(SybaseBinary x, SybaseBinary y)
        {
            int lengthDiff = 0;

            if (x.Length != y.Length)
            {
                lengthDiff = x.Length - y.Length;

                // if diff more than 0, x is longer
                if (lengthDiff > 0)
                {
                    for (int i = x.Length - 1; i > x.Length - lengthDiff; i -= 1)
                    {
                        if (x [i] != (byte)0)
                        {
                            return(1);
                        }
                    }
                }
                else
                {
                    for (int i = y.Length - 1; i > y.Length - lengthDiff; i -= 1)
                    {
                        if (y [i] != (byte)0)
                        {
                            return(-1);
                        }
                    }
                }
            }

            // choose shorter
            int len = (lengthDiff > 0) ? y.Length : x.Length;

            for (int i = len - 1; i > 0; i -= 1)
            {
                byte bx = x [i];
                byte by = y [i];

                if (bx > by)
                {
                    return(1);
                }
                else if (bx < by)
                {
                    return(-1);
                }
            }

            return(0);
        }
Exemple #2
0
 public static SybaseBoolean LessThanOrEqual(SybaseBinary x, SybaseBinary y)
 {
     return(x <= y);
 }
Exemple #3
0
 public static SybaseBoolean NotEquals(SybaseBinary x, SybaseBinary y)
 {
     return(x != y);
 }
Exemple #4
0
 public static SybaseBoolean GreaterThanOrEqual(SybaseBinary x, SybaseBinary y)
 {
     return(x >= y);
 }
Exemple #5
0
 public static SybaseBoolean LessThan(SybaseBinary x, SybaseBinary y)
 {
     return(x < y);
 }
Exemple #6
0
 public static SybaseBinary Concat(SybaseBinary x, SybaseBinary y)
 {
     return(x + y);
 }
Exemple #7
0
 public static SybaseBoolean GreaterThan(SybaseBinary x, SybaseBinary y)
 {
     return(x > y);
 }
		public static SybaseBoolean NotEquals (SybaseBinary x, SybaseBinary y) 
		{
			return (x != y);
		}
		private static int Compare (SybaseBinary x, SybaseBinary y)
		{
			int lengthDiff = 0;
			
			if (x.Length != y.Length) {
				lengthDiff = x.Length - y.Length;
				
				// if diff more than 0, x is longer
				if (lengthDiff > 0) {
					for (int i = x.Length - 1; i > x.Length - lengthDiff; i -= 1) 
						if (x [i] != (byte) 0)
							return 1;
				} else {
					for (int i = y.Length - 1; i > y.Length - lengthDiff; i -= 1) 
						if (y [i] != (byte) 0)
							return -1;
				}
			}

			// choose shorter
			int len = (lengthDiff > 0) ? y.Length : x.Length;

			for (int i = len - 1; i > 0; i -= 1) {
				byte bx = x [i];
				byte by = y [i];

				if (bx > by)
					return 1;
				else if (bx < by)
					return -1;
			}

			return 0;
		}
		public static SybaseBoolean LessThanOrEqual (SybaseBinary x, SybaseBinary y) 
		{
			return (x <= y);
		}
		public static SybaseBoolean LessThan (SybaseBinary x, SybaseBinary y) 
		{
			return (x < y);
		}
		public static SybaseBoolean GreaterThanOrEqual (SybaseBinary x, SybaseBinary y) 
		{
			return (x >= y);
		}
		public static SybaseBoolean GreaterThan (SybaseBinary x, SybaseBinary y) 
		{
			return (x > y);
		}
		public static SybaseBinary Concat (SybaseBinary x, SybaseBinary y) 
		{
			return (x + y);
		}