.TH "KShred" 3 "28 Jan 2004" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KShred \- Erase a file in a way that makes recovery impossible -- well, no guarentee of that, but at least as difficult as reasonably possible.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kshred.h>\fP
.PP
Inherits \fBQObject\fP.
.PP
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBprocessedSize\fP (KIO::filesize_t bytes)"
.br
.RI "\fIShows progress of the shredding. \fP"
.ti -1c
.RI "void \fBinfoMessage\fP (const  \fBQString\fP &)"
.br
.RI "\fIShows a message in the progress dialog. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKShred\fP (\fBQString\fP fileName)"
.br
.RI "\fIInitialize the class using the name of the file to 'shred'. \fP"
.ti -1c
.RI "bool \fBfill1s\fP ()"
.br
.RI "\fIWrites all 1's over the entire file and flushes the file buffers. \fP"
.ti -1c
.RI "bool \fBfill0s\fP ()"
.br
.RI "\fIWrites all 0's over the entire file and flushes the file buffers. \fP"
.ti -1c
.RI "bool \fBfillbyte\fP (unsigned int byte)"
.br
.RI "\fIWrites the specified byte over the entire file and flushes the file buffers. \fP"
.ti -1c
.RI "bool \fBfillrandom\fP ()"
.br
.RI "\fIWrites random bites over the entire file and flushes the file buffers. \fP"
.ti -1c
.RI "bool \fBfillpattern\fP (unsigned char *pattern, unsigned int size)"
.br
.RI "\fIWrites the specified byte array over the entire file and flushes the file buffers. \fP"
.ti -1c
.RI "bool \fBshred\fP ()"
.br
.RI "\fIShreds a file by writing a series of values over it (uses \fBfill0s\fP, then \fBfill1s\fP, then \fBfillrandom\fP, then \fBfillbyte\fP with 0101..., then \fBfillbyte\fP with 1010.... \fP"
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "bool \fBshred\fP (\fBQString\fP fileName)"
.br
.RI "\fIThe simplest method to shred a file. \fP"
.in -1c
.SH "Detailed Description"
.PP 
Erase a file in a way that makes recovery impossible -- well, no guarentee of that, but at least as difficult as reasonably possible. 

For this, KShred write several times over the existing file, using different patterns, before deleting it. 
.PP
\fBAuthor:\fP
.RS 4
Andreas F. Pour <bugs@mieterra.com> 
.PP
David Faure <faure@kde.org> (integration into \fBKDE\fP and progress signal) 
.RE
.PP

.PP
Definition at line 45 of file kshred.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KShred::KShred (\fBQString\fP fileName)"
.PP
Initialize the class using the name of the file to 'shred'. \fBParameters:\fP
.RS 4
\fIfileName\fP fully qualified name of the file to shred.
.RE
.PP
Definition at line 30 of file kshred.cpp.
.PP
References QString::isEmpty(), QString::local8Bit(), QFile::open(), QFile::setName(), and QFile::size().
.SH "Member Function Documentation"
.PP 
.SS "bool KShred::fill1s ()"
.PP
Writes all 1's over the entire file and flushes the file buffers. \fBReturns:\fP
.RS 4
true on success, false on error (invalid filename or write error)
.RE
.PP
Definition at line 67 of file kshred.cpp.
.PP
References fillbyte().
.SS "bool KShred::fill0s ()"
.PP
Writes all 0's over the entire file and flushes the file buffers. \fBReturns:\fP
.RS 4
true on success, false on error (invalid filename or write error)
.RE
.PP
Definition at line 74 of file kshred.cpp.
.PP
References fillbyte().
.SS "bool KShred::fillbyte (unsigned int byte)"
.PP
Writes the specified byte over the entire file and flushes the file buffers. \fBParameters:\fP
.RS 4
\fIbyte\fP the value to write over every byte of the file 
.RE
.PP
\fBReturns:\fP
.RS 4
true on success, false on error (invalid filename or write error)
.RE
.PP
Definition at line 81 of file kshred.cpp.
.PP
Referenced by fill0s(), fill1s(), and shred().
.SS "bool KShred::fillrandom ()"
.PP
Writes random bites over the entire file and flushes the file buffers. \fBReturns:\fP
.RS 4
true on success, false on error (invalid filename or write error)
.RE
.PP
Definition at line 121 of file kshred.cpp.
.PP
Referenced by shred().
.SS "bool KShred::fillpattern (unsigned char * pattern, unsigned int size)"
.PP
Writes the specified byte array over the entire file and flushes the file buffers. \fBParameters:\fP
.RS 4
\fIpattern\fP the value to write over the entire file 
.br
\fIsize\fP the length of the 'pattern' byte array 
.RE
.PP
\fBReturns:\fP
.RS 4
true on success, false on error (invalid filename or write error)
.RE
.PP
Definition at line 102 of file kshred.cpp.
.PP
Referenced by shred().
.SS "bool KShred::shred ()"
.PP
Shreds a file by writing a series of values over it (uses \fBfill0s\fP, then \fBfill1s\fP, then \fBfillrandom\fP, then \fBfillbyte\fP with 0101..., then \fBfillbyte\fP with 1010.... \fBReturns:\fP
.RS 4
true on success, false on error (invalid filename or write error) 
.RE
.PP
Definition at line 205 of file kshred.cpp.
.PP
References QString::arg(), fillbyte(), fillpattern(), fillrandom(), infoMessage(), processedSize(), and QFile::remove().
.PP
Referenced by shred().
.SS "bool KShred::shred (\fBQString\fP fileName)\fC [static]\fP"
.PP
The simplest method to shred a file. No need to create an instance of the class. 
.PP
\fBParameters:\fP
.RS 4
\fIfileName\fP fully qualified name of the file to shred. 
.RE
.PP
Definition at line 147 of file kshred.cpp.
.PP
References QString::isEmpty(), and shred().
.SS "void KShred::processedSize (KIO::filesize_t bytes)\fC [signal]\fP"
.PP
Shows progress of the shredding. \fBParameters:\fP
.RS 4
\fIbytes\fP the number of bytes written to the file 
.RE
.PP
Referenced by shred().
.SS "void KShred::infoMessage (const \fBQString\fP &)\fC [signal]\fP"
.PP
Shows a message in the progress dialog. \fBParameters:\fP
.RS 4
\fIthe\fP message to display 
.RE
.PP
Referenced by shred().

.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
