Example #1
0
 public string OwnerName()
 {
     try
     {
         return(CppToCsharpAdapter.OwnerName(my_hash_file_pointer));
     }
     catch (SEHException ex)
     {
         return(CppToCsharpAdapter.GetLastErrorMessage(this.my_hash_file_pointer));
     }
     catch
     {
         throw;
     }
 }
Example #2
0
 public int OverflowAreaStart()
 {
     try
     {
         return(CppToCsharpAdapter.OverflowAreaStart(my_hash_file_pointer));
     }
     catch (SEHException ex)
     {
         string message = CppToCsharpAdapter.GetLastErrorMessage(this.my_hash_file_pointer);
         throw new Exception(message);
     }
     catch
     {
         throw;
     }
 }
Example #3
0
 public int NrOfRecsInFile()
 {
     try
     {
         return(CppToCsharpAdapter.NrOfRecsInFile(my_hash_file_pointer));
     }
     catch (SEHException ex)
     {
         string message = CppToCsharpAdapter.GetLastErrorMessage(this.my_hash_file_pointer);
         throw new Exception(message);
     }
     catch
     {
         throw;
     }
 }
Example #4
0
 public string GetBlockInfo(int blockNumber)
 {
     try
     {
         return(CppToCsharpAdapter.GetBlockInfo(my_hash_file_pointer, blockNumber));
     }
     catch (SEHException ex)
     {
         string message = CppToCsharpAdapter.GetLastErrorMessage(this.my_hash_file_pointer);
         throw new Exception(message);
     }
     catch
     {
         throw;
     }
 }
Example #5
0
 public int HashStringSimulation(string[] arr, int fileSize)
 {
     try
     {
         return(CppToCsharpAdapter.HashStringSimulation(my_hash_file_pointer, arr, arr.Length, fileSize));
     }
     catch (SEHException)
     {
         string message = CppToCsharpAdapter.GetLastErrorMessage(this.my_hash_file_pointer);
         throw new Exception(message);
     }
     catch
     {
         throw;
     }
 }
Example #6
0
 public bool Check_If_Key_Is_In_This_Block(int hashnum, char[] Key)
 {
     try
     {
         return(CppToCsharpAdapter.Check_If_Key_Is_In_This_Block(my_hash_file_pointer, hashnum, Key));
     }
     catch (SEHException ex)
     {
         string message = CppToCsharpAdapter.GetLastErrorMessage(this.my_hash_file_pointer);
         throw new Exception(message);
     }
     catch
     {
         throw;
     }
 }
Example #7
0
 public void updateoff()
 {
     try
     {
         CppToCsharpAdapter.updateoff(my_hash_file_pointer);
     }
     catch (SEHException ex)
     {
         string message = CppToCsharpAdapter.GetLastErrorMessage(this.my_hash_file_pointer);
         throw new Exception(message);
     }
     catch
     {
         throw;
     }
 }
Example #8
0
 public void Del_rec_Casing(string Key)
 {
     try
     {
         CppToCsharpAdapter.Del_rec_Casing(my_hash_file_pointer, Key);
     }
     catch (SEHException ex)
     {
         string message = CppToCsharpAdapter.GetLastErrorMessage(this.my_hash_file_pointer);
         throw new Exception(message);
     }
     catch
     {
         throw;
     }
 }
Example #9
0
 public void hopen(string filename, string usernam, string path, string openmode)
 {
     try
     {
         CppToCsharpAdapter.hopen(my_hash_file_pointer, filename, usernam, path, openmode);
     }
     catch (SEHException ex)
     {
         string message = CppToCsharpAdapter.GetLastErrorMessage(this.my_hash_file_pointer);
         throw new Exception(message);
     }
     catch
     {
         throw;
     }
 }
Example #10
0
 public string IntToString(int a)
 {
     try
     {
         return(CppToCsharpAdapter.int_to_string(my_hash_file_pointer, a));
     }
     catch (SEHException ex)
     {
         string message = CppToCsharpAdapter.GetLastErrorMessage(this.my_hash_file_pointer);
         throw new Exception(message + ex);
     }
     catch
     {
         throw;
     }
 }
Example #11
0
 public string filename()
 {
     try
     {
         string str = CppToCsharpAdapter.filename(my_hash_file_pointer);
         return(str);
     }
     catch (SEHException ex)
     {
         string message = CppToCsharpAdapter.GetLastErrorMessage(this.my_hash_file_pointer);
         throw new Exception(message);
     }
     catch
     {
         throw;
     }
 }
Example #12
0
 public float load_factor()
 {
     try
     {
         float str = CppToCsharpAdapter.load_factor(my_hash_file_pointer);
         return(str);
     }
     catch (SEHException ex)
     {
         string message = CppToCsharpAdapter.GetLastErrorMessage(this.my_hash_file_pointer);
         throw new Exception(message);
     }
     catch
     {
         throw;
     }
 }
Example #13
0
 public void hcreate(string filenam = "", string usernam = "", int longrecord = 0, string path    = "", int sizefile = 0,
                     int keyloc     = 0, string type     = "I", int keylong   = 4, int hashfuncid = 1)
 {
     try
     {
         CppToCsharpAdapter.hcreate(my_hash_file_pointer, filenam, usernam, longrecord, path, sizefile, keyloc, type, keylong, hashfuncid);
     }
     catch (SEHException ex)
     {
         string message = CppToCsharpAdapter.GetLastErrorMessage(this.my_hash_file_pointer);
         throw new Exception(message);
     }
     catch
     {
         throw;
     }
 }
Example #14
0
        public void Update(Object obj)
        {
            try
            {
                IntPtr buffer = Marshal.AllocHGlobal(Marshal.SizeOf(obj.GetType()));
                Marshal.StructureToPtr(obj, buffer, true);

                CppToCsharpAdapter.Update(my_hash_file_pointer, buffer);

                Marshal.FreeHGlobal(buffer);
            }
            catch (SEHException ex)
            {
                string message = CppToCsharpAdapter.GetLastErrorMessage(this.my_hash_file_pointer);
                throw new Exception(message);
            }
            catch
            {
                throw;
            }
        }
Example #15
0
        public Object Read(int key, Object obj, int update = 0)
        {
            try
            {
                IntPtr buffer;
                buffer = Marshal.AllocHGlobal(Marshal.SizeOf(obj.GetType()));

                CppToCsharpAdapter.read(my_hash_file_pointer, key, buffer, update);
                Marshal.PtrToStructure(buffer, obj);

                //Marshal.FreeHGlobal(buffer);

                return(obj);
            }
            catch (SEHException ex)
            {
                string message = CppToCsharpAdapter.GetLastErrorMessage(this.my_hash_file_pointer);
                throw new Exception(message);
            }
            catch
            {
                throw;
            }
        }
Example #16
0
 public HashFile()
 {
     my_hash_file_pointer = CppToCsharpAdapter.MakeHashFileObject();
 }