Ejemplo n.º 1
0
        /// <summary>
        /// Sets the prefix comparison function
        /// </summary>
        /// <remarks>
        /// This method wraps the native ham_set_prefix_compare_func function.<br />
        /// <br />
        /// The <see cref="PrefixCompareFunc" /> delegate is called when an index
        /// uses keys with variable length, and at least one of the keys
        /// is loaded only partially.<br />
        /// <br />
        /// If <paramref name="foo"/> is null, hamsterdb will use the default
        /// prefix compare function (which is based on memcmp(3)).<br />
        /// </remarks>
        /// <param name="foo">The prefix compare delegate, or null</param>
        public void SetPrefixCompareFunc(PrefixCompareFunc foo)
        {
            int st;

            lock (this) {
                st = NativeMethods.SetPrefixCompareFunc(handle,
                                                        pinnedPrefixCompareFunc);
            }
            if (st != 0)
            {
                throw new DatabaseException(st);
            }
            PrefixCompareFoo = foo;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Sets the prefix comparison function
 /// </summary>
 /// <remarks>
 /// This method wraps the native ham_set_prefix_compare_func function.<br />
 /// <br />
 /// The <see cref="PrefixCompareFunc" /> delegate is called when an index
 /// uses keys with variable length, and at least one of the keys
 /// is loaded only partially.<br />
 /// <br />
 /// If <paramref name="foo"/> is null, hamsterdb will use the default
 /// prefix compare function (which is based on memcmp(3)).<br />
 /// </remarks>
 /// <param name="foo">The prefix compare delegate, or null</param>
 public void SetPrefixCompareFunc(PrefixCompareFunc foo)
 {
     int st;
     lock (this) {
         st = NativeMethods.SetPrefixCompareFunc(handle,
             pinnedPrefixCompareFunc);
     }
     if (st != 0)
         throw new DatabaseException(st);
     PrefixCompareFoo = foo;
 }