/// <summary> /// Write the key/data pairs from all databases in the file to /// <paramref name="OutputStream"/>. Key values are written for Btree, /// Hash and Queue databases, but not for Recno databases. /// </summary> /// <param name="file"> /// The physical file in which the databases to be salvaged are found. /// </param> /// <param name="cfg"> /// Configuration parameters for the databases to be salvaged. /// </param> /// <param name="Printable"> /// If true and characters in either the key or data items are printing /// characters (as defined by isprint(3)), use printing characters to /// represent them. This setting permits users to use standard text /// editors and tools to modify the contents of databases or selectively /// remove data from salvager output. /// </param> /// <param name="Aggressive"> /// If true, output all the key/data pairs in the file that can be /// found. Corruption will be assumed and key/data pairs that are /// corrupted or have been deleted may appear in the output (even if the /// file being salvaged is in no way corrupt), and the output will /// almost certainly require editing before being loaded into a /// database. /// </param> /// <param name="OutputStream"> /// The TextWriter to which the databases' key/data pairs are written. /// If null, <see cref="Console.Out"/> will be used. /// </param> public static void Salvage(string file, DatabaseConfig cfg, bool Printable, bool Aggressive, TextWriter OutputStream) { using (Database db = new Database(cfg.Env, 0)) { db.Config(cfg); if (OutputStream == null) { OutputStream = Console.Out; } uint flags = DbConstants.DB_SALVAGE; flags |= Aggressive ? DbConstants.DB_AGGRESSIVE : 0; flags |= Printable ? DbConstants.DB_PRINTABLE : 0; writeToFileRef = new BDB_FileWriteDelegate(writeToFile); db.db.verify(file, null, OutputStream, writeToFileRef, flags); } }
/// <summary> /// Write the key/data pairs from all databases in the file to /// <paramref name="OutputStream"/>. Key values are written for Btree, /// Hash and Queue databases, but not for Recno databases. /// </summary> /// <param name="file"> /// The physical file in which the databases to be salvaged are found. /// </param> /// <param name="cfg"> /// Configuration parameters for the databases to be salvaged. /// </param> /// <param name="Printable"> /// If true and characters in either the key or data items are printing /// characters (as defined by isprint(3)), use printing characters to /// represent them. This setting permits users to use standard text /// editors and tools to modify the contents of databases or selectively /// remove data from salvager output. /// </param> /// <param name="Aggressive"> /// If true, output all the key/data pairs found in the file. /// Corruption of these data pairs is assumed, and corrupted or deleted /// data pairs may appear in the output (even if the salvaged file is in no /// way corrupt). This output almost certainly requires editing before being /// loaded into a database. /// </param> /// <param name="OutputStream"> /// The TextWriter to which the databases' key/data pairs are written. /// If null, <see cref="Console.Out"/> is used. /// </param> public static void Salvage(string file, DatabaseConfig cfg, bool Printable, bool Aggressive, TextWriter OutputStream) { using (Database db = new Database(cfg.Env, 0)) { db.Config(cfg); if (OutputStream == null) OutputStream = Console.Out; uint flags = DbConstants.DB_SALVAGE; flags |= Aggressive ? DbConstants.DB_AGGRESSIVE : 0; flags |= Printable ? DbConstants.DB_PRINTABLE : 0; writeToFileRef = new BDB_FileWriteDelegate(writeToFile); db.db.verify(file, null, OutputStream, writeToFileRef, flags); } }
internal int verify(string file, string database, System.IO.TextWriter handle, BDB_FileWriteDelegate callback, uint flags) { int ret; ret = libdb_csharpPINVOKE.DB_verify(swigCPtr, file, database, handle, callback, flags); /* Verify is a db handle destructor. Reflect that in the wrapper class. */ swigCMemOwn = false; swigCPtr = new HandleRef(null, IntPtr.Zero); DatabaseException.ThrowException(ret); return ret; }
internal int verify(string file, string database, System.IO.TextWriter handle, BDB_FileWriteDelegate callback, uint flags) { int ret; ret = libdb_csharpPINVOKE.DB_verify(swigCPtr, file, database, handle, callback, flags); /* Verify is a db handle destructor. Reflect that in the wrapper class. */ swigCMemOwn = false; swigCPtr = new HandleRef(null, IntPtr.Zero); DatabaseException.ThrowException(ret); return(ret); }
public static extern int DB_verify(HandleRef jarg1, string jarg2, string jarg3, System.IO.TextWriter jarg4, BDB_FileWriteDelegate jarg5, uint jarg6);