\section{KShred Class Reference}
\label{classKShred}\index{KShred@{KShred}}
Erase a file in a way that makes recovery impossible -- well, no guarentee of that, but at least as difficult as reasonably possible.  


{\tt \#include $<$kshred.h$>$}

Inheritance diagram for KShred:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=43pt]{classKShred__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KShred:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=74pt]{classKShred__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf processed\-Size} (KIO::filesize\_\-t bytes)
\begin{CompactList}\small\item\em Shows progress of the shredding. \item\end{CompactList}\item 
void {\bf info\-Message} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Shows a message in the progress dialog. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KShred} ({\bf QString} file\-Name)
\begin{CompactList}\small\item\em Initialize the class using the name of the file to 'shred'. \item\end{CompactList}\item 
bool {\bf fill1s} ()
\begin{CompactList}\small\item\em Writes all 1's over the entire file and flushes the file buffers. \item\end{CompactList}\item 
bool {\bf fill0s} ()
\begin{CompactList}\small\item\em Writes all 0's over the entire file and flushes the file buffers. \item\end{CompactList}\item 
bool {\bf fillbyte} (unsigned int byte)
\begin{CompactList}\small\item\em Writes the specified byte over the entire file and flushes the file buffers. \item\end{CompactList}\item 
bool {\bf fillrandom} ()
\begin{CompactList}\small\item\em Writes random bites over the entire file and flushes the file buffers. \item\end{CompactList}\item 
bool {\bf fillpattern} (unsigned char $\ast$pattern, unsigned int size)
\begin{CompactList}\small\item\em Writes the specified byte array over the entire file and flushes the file buffers. \item\end{CompactList}\item 
bool {\bf shred} ()
\begin{CompactList}\small\item\em Shreds a file by writing a series of values over it (uses {\bf fill0s}{\rm (p.\,\pageref{classKShred_a3})}, then {\bf fill1s}{\rm (p.\,\pageref{classKShred_a2})}, then {\bf fillrandom}{\rm (p.\,\pageref{classKShred_a5})}, then {\bf fillbyte}{\rm (p.\,\pageref{classKShred_a4})} with 0101..., then {\bf fillbyte}{\rm (p.\,\pageref{classKShred_a4})} with 1010.... \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
bool {\bf shred} ({\bf QString} file\-Name)
\begin{CompactList}\small\item\em The simplest method to shred a file. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
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. \begin{Desc}
\item[Author:]Andreas F. Pour $<${\tt bugs@mieterra.com}$>$ 

David Faure $<${\tt faure@kde.org}$>$ (integration into {\bf KDE} and progress signal) \end{Desc}




Definition at line 45 of file kshred.h.

\subsection{Constructor \& Destructor Documentation}
\index{KShred@{KShred}!KShred@{KShred}}
\index{KShred@{KShred}!KShred@{KShred}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KShred::KShred ({\bf QString} {\em file\-Name})}\label{classKShred_a0}


Initialize the class using the name of the file to 'shred'. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em file\-Name}]fully qualified name of the file to shred.\end{description}
\end{Desc}


Definition at line 30 of file kshred.cpp.

References QString::is\-Empty(), QString::local8Bit(), QFile::open(), QFile::set\-Name(), and QFile::size().

\subsection{Member Function Documentation}
\index{KShred@{KShred}!fill1s@{fill1s}}
\index{fill1s@{fill1s}!KShred@{KShred}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShred::fill1s ()}\label{classKShred_a2}


Writes all 1's over the entire file and flushes the file buffers. 

\begin{Desc}
\item[Returns:]true on success, false on error (invalid filename or write error)\end{Desc}


Definition at line 67 of file kshred.cpp.

References fillbyte().\index{KShred@{KShred}!fill0s@{fill0s}}
\index{fill0s@{fill0s}!KShred@{KShred}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShred::fill0s ()}\label{classKShred_a3}


Writes all 0's over the entire file and flushes the file buffers. 

\begin{Desc}
\item[Returns:]true on success, false on error (invalid filename or write error)\end{Desc}


Definition at line 74 of file kshred.cpp.

References fillbyte().\index{KShred@{KShred}!fillbyte@{fillbyte}}
\index{fillbyte@{fillbyte}!KShred@{KShred}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShred::fillbyte (unsigned int {\em byte})}\label{classKShred_a4}


Writes the specified byte over the entire file and flushes the file buffers. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em byte}]the value to write over every byte of the file \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true on success, false on error (invalid filename or write error)\end{Desc}


Definition at line 81 of file kshred.cpp.

Referenced by fill0s(), fill1s(), and shred().\index{KShred@{KShred}!fillrandom@{fillrandom}}
\index{fillrandom@{fillrandom}!KShred@{KShred}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShred::fillrandom ()}\label{classKShred_a5}


Writes random bites over the entire file and flushes the file buffers. 

\begin{Desc}
\item[Returns:]true on success, false on error (invalid filename or write error)\end{Desc}


Definition at line 121 of file kshred.cpp.

Referenced by shred().\index{KShred@{KShred}!fillpattern@{fillpattern}}
\index{fillpattern@{fillpattern}!KShred@{KShred}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShred::fillpattern (unsigned char $\ast$ {\em pattern}, unsigned int {\em size})}\label{classKShred_a6}


Writes the specified byte array over the entire file and flushes the file buffers. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pattern}]the value to write over the entire file \item[{\em size}]the length of the 'pattern' byte array \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true on success, false on error (invalid filename or write error)\end{Desc}


Definition at line 102 of file kshred.cpp.

Referenced by shred().\index{KShred@{KShred}!shred@{shred}}
\index{shred@{shred}!KShred@{KShred}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShred::shred ()}\label{classKShred_a7}


Shreds a file by writing a series of values over it (uses {\bf fill0s}{\rm (p.\,\pageref{classKShred_a3})}, then {\bf fill1s}{\rm (p.\,\pageref{classKShred_a2})}, then {\bf fillrandom}{\rm (p.\,\pageref{classKShred_a5})}, then {\bf fillbyte}{\rm (p.\,\pageref{classKShred_a4})} with 0101..., then {\bf fillbyte}{\rm (p.\,\pageref{classKShred_a4})} with 1010.... 

\begin{Desc}
\item[Returns:]true on success, false on error (invalid filename or write error) \end{Desc}


Definition at line 205 of file kshred.cpp.

References QString::arg(), fillbyte(), fillpattern(), fillrandom(), info\-Message(), processed\-Size(), and QFile::remove().

Referenced by shred().\index{KShred@{KShred}!shred@{shred}}
\index{shred@{shred}!KShred@{KShred}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShred::shred ({\bf QString} {\em file\-Name})\hspace{0.3cm}{\tt  [static]}}\label{classKShred_e0}


The simplest method to shred a file. 

No need to create an instance of the class. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em file\-Name}]fully qualified name of the file to shred. \end{description}
\end{Desc}


Definition at line 147 of file kshred.cpp.

References QString::is\-Empty(), and shred().\index{KShred@{KShred}!processedSize@{processedSize}}
\index{processedSize@{processedSize}!KShred@{KShred}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KShred::processed\-Size (KIO::filesize\_\-t {\em bytes})\hspace{0.3cm}{\tt  [signal]}}\label{classKShred_l0}


Shows progress of the shredding. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em bytes}]the number of bytes written to the file \end{description}
\end{Desc}


Referenced by shred().\index{KShred@{KShred}!infoMessage@{infoMessage}}
\index{infoMessage@{infoMessage}!KShred@{KShred}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KShred::info\-Message (const {\bf QString} \&)\hspace{0.3cm}{\tt  [signal]}}\label{classKShred_l1}


Shows a message in the progress dialog. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em the}]message to display \end{description}
\end{Desc}


Referenced by shred().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kshred.h\item 
kshred.cpp\end{CompactItemize}
