\section{U\-T\-I\-L\-:\-:L\-C\-Split\-Writer Class Reference}
\label{classUTIL_1_1LCSplitWriter}\index{U\-T\-I\-L\-::\-L\-C\-Split\-Writer@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}}


L\-C\-Writer wrapper that automatically splits files if a given number of bytes is exceeded.  




{\ttfamily \#include $<$U\-T\-I\-L/\-L\-C\-Split\-Writer.\-h$>$}

Inheritance diagram for U\-T\-I\-L\-:\-:L\-C\-Split\-Writer\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classUTIL_1_1LCSplitWriter}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\bf L\-C\-Split\-Writer} ({\bf I\-O\-::\-L\-C\-Writer} $\ast$wrt, {\bf E\-V\-E\-N\-T\-::long64} max\-Bytes)
\begin{DoxyCompactList}\small\item\em The constructor. \end{DoxyCompactList}\item 
virtual {\bf $\sim$\-L\-C\-Split\-Writer} ()\label{classUTIL_1_1LCSplitWriter_a8790a424e6d7fcd4b7a757f738489bd0}

\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item 
virtual void {\bf open} (const std\-::string \&filename)  throw (\-I\-O\-::\-I\-O\-Exception, std\-::exception )
\begin{DoxyCompactList}\small\item\em Opens a file for writing where the filename has to include the extension but not the number, e.\-g. \end{DoxyCompactList}\item 
virtual void {\bf open} (const std\-::string \&filename, int write\-Mode)  throw (\-I\-O\-::\-I\-O\-Exception, std\-::exception )
\begin{DoxyCompactList}\small\item\em Not implemented -\/ will throw an Exception if called. \end{DoxyCompactList}\item 
virtual void {\bf write\-Run\-Header} (const {\bf E\-V\-E\-N\-T\-::\-L\-C\-Run\-Header} $\ast$hdr)  throw (\-I\-O\-::\-I\-O\-Exception, std\-::exception )
\begin{DoxyCompactList}\small\item\em Writes the given run header to file. \end{DoxyCompactList}\item 
virtual void {\bf set\-Compression\-Level} (int level)
\begin{DoxyCompactList}\small\item\em Set Compression\-Level. \end{DoxyCompactList}\item 
virtual void {\bf write\-Event} (const {\bf E\-V\-E\-N\-T\-::\-L\-C\-Event} $\ast$evt)  throw (\-I\-O\-::\-I\-O\-Exception, std\-::exception )
\begin{DoxyCompactList}\small\item\em Writes the given file to file. \end{DoxyCompactList}\item 
virtual void {\bf close} ()  throw (\-I\-O\-::\-I\-O\-Exception, std\-::exception )
\begin{DoxyCompactList}\small\item\em Closes the output file/stream. \end{DoxyCompactList}\item 
virtual void {\bf flush} ()  throw (\-I\-O\-::\-I\-O\-Exception, std\-::exception )
\begin{DoxyCompactList}\small\item\em Flushes the output file/stream. \end{DoxyCompactList}\item 
{\bf E\-V\-E\-N\-T\-::long64} {\bf file\-Size} ()\label{classUTIL_1_1LCSplitWriter_aa32b627579f104970baa6ada23003be4}

\begin{DoxyCompactList}\small\item\em Return the current file size in bytes. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
{\bf E\-V\-E\-N\-T\-::long64} {\bf file\-\_\-size} (const char $\ast$fname)\label{classUTIL_1_1LCSplitWriter_a8f1aabebf51fe7df372909f4bdb02397}

\begin{DoxyCompactList}\small\item\em Helper function that returns the file size in bytes -\/ o if the file does not exist. \end{DoxyCompactList}\item 
const std\-::string \& {\bf get\-Filename} ()
\begin{DoxyCompactList}\small\item\em Get the complete filename w/o extensiomn,e.\-g. \end{DoxyCompactList}\item 
void {\bf set\-Base\-Filename} (const std\-::string \&filename)
\begin{DoxyCompactList}\small\item\em Helper function to determine base file name, i.\-e. \end{DoxyCompactList}\item 
std\-::string {\bf get\-Counting\-String} (unsigned count)
\begin{DoxyCompactList}\small\item\em Returns the string representation of the file number, e.\-g. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
{\bf I\-O\-::\-L\-C\-Writer} $\ast$ {\bfseries \-\_\-wrt}\label{classUTIL_1_1LCSplitWriter_a4db3669efb9952f3bc86befb91fc2947}

\item 
{\bf E\-V\-E\-N\-T\-::long64} {\bfseries \-\_\-max\-Bytes}\label{classUTIL_1_1LCSplitWriter_a462d85c0e52a8119a7de68542a946b33}

\item 
std\-::string {\bfseries \-\_\-base\-Filename}\label{classUTIL_1_1LCSplitWriter_a5ad9f1d91277a6ef156b6bdf3e033f0a}

\item 
std\-::string {\bfseries \-\_\-filename}\label{classUTIL_1_1LCSplitWriter_ae29b7b0d1740b9aea5393311fa97df15}

\item 
std\-::string {\bfseries \-\_\-extension}\label{classUTIL_1_1LCSplitWriter_a81a699cf4b883d4c010cb1827f43bc52}

\item 
unsigned {\bfseries \-\_\-count}\label{classUTIL_1_1LCSplitWriter_a80a766492604784151aca83dd735d8ec}

\item 
unsigned {\bfseries \-\_\-last\-Count}\label{classUTIL_1_1LCSplitWriter_a04c31512a47401e256414083b273c5d7}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
L\-C\-Writer wrapper that automatically splits files if a given number of bytes is exceeded. 

File names are extended by a file number of the form .000 -\/ .999 ... \par
 \begin{DoxyAuthor}{Author}
gaede 
\end{DoxyAuthor}
\begin{DoxyVersion}{Version}

\end{DoxyVersion}
\begin{DoxyParagraph}{Id\-:}
\doxyref{L\-C\-Split\-Writer.\-h}{p.}{LCSplitWriter_8h_source},v 1.\-2 2007-\/11-\/09 21\-:00\-:55 gaede Exp 
\end{DoxyParagraph}


\subsection{Constructor \& Destructor Documentation}
\index{U\-T\-I\-L\-::\-L\-C\-Split\-Writer@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}!L\-C\-Split\-Writer@{L\-C\-Split\-Writer}}
\index{L\-C\-Split\-Writer@{L\-C\-Split\-Writer}!UTIL::LCSplitWriter@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}}
\subsubsection[{L\-C\-Split\-Writer}]{\setlength{\rightskip}{0pt plus 5cm}U\-T\-I\-L\-::\-L\-C\-Split\-Writer\-::\-L\-C\-Split\-Writer (
\begin{DoxyParamCaption}
\item[{{\bf I\-O\-::\-L\-C\-Writer} $\ast$}]{wrt, }
\item[{{\bf E\-V\-E\-N\-T\-::long64}}]{max\-Bytes}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classUTIL_1_1LCSplitWriter_a390f54b9b71b910496f538463bb1aa8f}


The constructor. 

Takes a pointer to a valid L\-C\-Writer instance and the file size in bytes that causes a new file to be opened if exceeded.{\bfseries  example\-:\par
 // replace L\-C\-Writer$\ast$ lc\-Wrt = L\-C\-Factory\-::get\-Instance()-\/$>$create\-L\-C\-Writer() ; // with L\-C\-Split\-Writer$\ast$ lc\-Wrt = new \doxyref{L\-C\-Split\-Writer}{p.}{classUTIL_1_1LCSplitWriter}( L\-C\-Factory\-::get\-Instance()-\/$>$create\-L\-C\-Writer() , 2040109465 ) ;\par
 to automatically split files after 1.\-9 G\-Byte file size has been exceeded. }

\subsection{Member Function Documentation}
\index{U\-T\-I\-L\-::\-L\-C\-Split\-Writer@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}!close@{close}}
\index{close@{close}!UTIL::LCSplitWriter@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}}
\subsubsection[{close}]{\setlength{\rightskip}{0pt plus 5cm}void U\-T\-I\-L\-::\-L\-C\-Split\-Writer\-::close (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) throw  {\bf I\-O\-::\-I\-O\-Exception}, std\-::exception) \hspace{0.3cm}{\ttfamily [virtual]}}\label{classUTIL_1_1LCSplitWriter_a739548b91831d839601ef1f593615c6a}


Closes the output file/stream. 


\begin{DoxyExceptions}{Exceptions}
{\em \doxyref{I\-O\-::\-I\-O\-Exception}{p.}{classIO_1_1IOException}} & \\
\hline
\end{DoxyExceptions}


Implements {\bf I\-O\-::\-L\-C\-Writer} \doxyref{}{p.}{classIO_1_1LCWriter_ac9325019beaa7f564dc50b483a97a4fe}.

\index{U\-T\-I\-L\-::\-L\-C\-Split\-Writer@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}!flush@{flush}}
\index{flush@{flush}!UTIL::LCSplitWriter@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}}
\subsubsection[{flush}]{\setlength{\rightskip}{0pt plus 5cm}void U\-T\-I\-L\-::\-L\-C\-Split\-Writer\-::flush (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) throw  {\bf I\-O\-::\-I\-O\-Exception}, std\-::exception) \hspace{0.3cm}{\ttfamily [virtual]}}\label{classUTIL_1_1LCSplitWriter_a91e2b888173c6757b66bd93a7fc08794}


Flushes the output file/stream. 


\begin{DoxyExceptions}{Exceptions}
{\em \doxyref{I\-O\-::\-I\-O\-Exception}{p.}{classIO_1_1IOException}} & \\
\hline
\end{DoxyExceptions}


Implements {\bf I\-O\-::\-L\-C\-Writer} \doxyref{}{p.}{classIO_1_1LCWriter_a219b699d06cddfc57e95db2320e14a6a}.

\index{U\-T\-I\-L\-::\-L\-C\-Split\-Writer@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}!get\-Counting\-String@{get\-Counting\-String}}
\index{get\-Counting\-String@{get\-Counting\-String}!UTIL::LCSplitWriter@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}}
\subsubsection[{get\-Counting\-String}]{\setlength{\rightskip}{0pt plus 5cm}std\-::string U\-T\-I\-L\-::\-L\-C\-Split\-Writer\-::get\-Counting\-String (
\begin{DoxyParamCaption}
\item[{unsigned}]{count}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}\label{classUTIL_1_1LCSplitWriter_aff76ea55e08822c167726037ae2b8ec3}


Returns the string representation of the file number, e.\-g. 

\char`\"{}007\char`\"{}. \index{U\-T\-I\-L\-::\-L\-C\-Split\-Writer@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}!get\-Filename@{get\-Filename}}
\index{get\-Filename@{get\-Filename}!UTIL::LCSplitWriter@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}}
\subsubsection[{get\-Filename}]{\setlength{\rightskip}{0pt plus 5cm}const std\-::string \& U\-T\-I\-L\-::\-L\-C\-Split\-Writer\-::get\-Filename (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}\label{classUTIL_1_1LCSplitWriter_a99fa5658258b4810d65232ab3e0b23d3}


Get the complete filename w/o extensiomn,e.\-g. 

My\-Filename.\-007 \index{U\-T\-I\-L\-::\-L\-C\-Split\-Writer@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}!open@{open}}
\index{open@{open}!UTIL::LCSplitWriter@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}}
\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}void U\-T\-I\-L\-::\-L\-C\-Split\-Writer\-::open (
\begin{DoxyParamCaption}
\item[{const std\-::string \&}]{filename}
\end{DoxyParamCaption}
) throw  {\bf I\-O\-::\-I\-O\-Exception}, std\-::exception) \hspace{0.3cm}{\ttfamily [virtual]}}\label{classUTIL_1_1LCSplitWriter_a6e70f92ba71f4e5dc32c37a3b6c8b801}


Opens a file for writing where the filename has to include the extension but not the number, e.\-g. 

myfile.\-slcio. Note that this is different from the L\-C\-Writer specification.


\begin{DoxyExceptions}{Exceptions}
{\em \doxyref{I\-O\-::\-I\-O\-Exception}{p.}{classIO_1_1IOException}} & \\
\hline
\end{DoxyExceptions}


Implements {\bf I\-O\-::\-L\-C\-Writer} \doxyref{}{p.}{classIO_1_1LCWriter_a6cba2fe84fec49d4895832c8e2ecdf93}.

\index{U\-T\-I\-L\-::\-L\-C\-Split\-Writer@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}!open@{open}}
\index{open@{open}!UTIL::LCSplitWriter@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}}
\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}void U\-T\-I\-L\-::\-L\-C\-Split\-Writer\-::open (
\begin{DoxyParamCaption}
\item[{const std\-::string \&}]{filename, }
\item[{int}]{write\-Mode}
\end{DoxyParamCaption}
) throw  {\bf I\-O\-::\-I\-O\-Exception}, std\-::exception) \hspace{0.3cm}{\ttfamily [virtual]}}\label{classUTIL_1_1LCSplitWriter_a4a0e7edf27b30a8e3b6607ac50d3b46b}


Not implemented -\/ will throw an Exception if called. 

Overwriting of or appending to split files is not straight forward. Pleas use the default write mode and remove exisiting files.


\begin{DoxyExceptions}{Exceptions}
{\em \doxyref{I\-O\-::\-I\-O\-Exception}{p.}{classIO_1_1IOException}} & \\
\hline
\end{DoxyExceptions}


Implements {\bf I\-O\-::\-L\-C\-Writer} \doxyref{}{p.}{classIO_1_1LCWriter_a662fe4082adbb608298c770e2821a960}.

\index{U\-T\-I\-L\-::\-L\-C\-Split\-Writer@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}!set\-Base\-Filename@{set\-Base\-Filename}}
\index{set\-Base\-Filename@{set\-Base\-Filename}!UTIL::LCSplitWriter@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}}
\subsubsection[{set\-Base\-Filename}]{\setlength{\rightskip}{0pt plus 5cm}void U\-T\-I\-L\-::\-L\-C\-Split\-Writer\-::set\-Base\-Filename (
\begin{DoxyParamCaption}
\item[{const std\-::string \&}]{filename}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}\label{classUTIL_1_1LCSplitWriter_a6b34865940dc64f36ad7430fd002ae9c}


Helper function to determine base file name, i.\-e. 

w/o extension. \index{U\-T\-I\-L\-::\-L\-C\-Split\-Writer@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}!set\-Compression\-Level@{set\-Compression\-Level}}
\index{set\-Compression\-Level@{set\-Compression\-Level}!UTIL::LCSplitWriter@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}}
\subsubsection[{set\-Compression\-Level}]{\setlength{\rightskip}{0pt plus 5cm}virtual void U\-T\-I\-L\-::\-L\-C\-Split\-Writer\-::set\-Compression\-Level (
\begin{DoxyParamCaption}
\item[{int}]{level}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}\label{classUTIL_1_1LCSplitWriter_aa261e4cf49e2451ef69b820b94558421}


Set Compression\-Level. 

\begin{DoxySeeAlso}{See Also}
L\-C\-Writer\-::set\-Compression\-Level() 
\end{DoxySeeAlso}


Implements {\bf I\-O\-::\-L\-C\-Writer} \doxyref{}{p.}{classIO_1_1LCWriter_a3ae107a90a1be82bf986ff716ecb63a7}.



References I\-O\-::\-L\-C\-Writer\-::set\-Compression\-Level().

\index{U\-T\-I\-L\-::\-L\-C\-Split\-Writer@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}!write\-Event@{write\-Event}}
\index{write\-Event@{write\-Event}!UTIL::LCSplitWriter@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}}
\subsubsection[{write\-Event}]{\setlength{\rightskip}{0pt plus 5cm}void U\-T\-I\-L\-::\-L\-C\-Split\-Writer\-::write\-Event (
\begin{DoxyParamCaption}
\item[{const {\bf E\-V\-E\-N\-T\-::\-L\-C\-Event} $\ast$}]{evt}
\end{DoxyParamCaption}
) throw  {\bf I\-O\-::\-I\-O\-Exception}, std\-::exception) \hspace{0.3cm}{\ttfamily [virtual]}}\label{classUTIL_1_1LCSplitWriter_a65946d1d80c70ebb6747534ef6236a06}


Writes the given file to file. 

Opens a new file if the given file size is already exceeded before the execution of the write access.


\begin{DoxyExceptions}{Exceptions}
{\em \doxyref{I\-O\-::\-I\-O\-Exception}{p.}{classIO_1_1IOException}} & \\
\hline
\end{DoxyExceptions}


Implements {\bf I\-O\-::\-L\-C\-Writer} \doxyref{}{p.}{classIO_1_1LCWriter_a145ee14a6b88915621b2074dbdea6a4b}.

\index{U\-T\-I\-L\-::\-L\-C\-Split\-Writer@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}!write\-Run\-Header@{write\-Run\-Header}}
\index{write\-Run\-Header@{write\-Run\-Header}!UTIL::LCSplitWriter@{U\-T\-I\-L\-::\-L\-C\-Split\-Writer}}
\subsubsection[{write\-Run\-Header}]{\setlength{\rightskip}{0pt plus 5cm}void U\-T\-I\-L\-::\-L\-C\-Split\-Writer\-::write\-Run\-Header (
\begin{DoxyParamCaption}
\item[{const {\bf E\-V\-E\-N\-T\-::\-L\-C\-Run\-Header} $\ast$}]{hdr}
\end{DoxyParamCaption}
) throw  {\bf I\-O\-::\-I\-O\-Exception}, std\-::exception) \hspace{0.3cm}{\ttfamily [virtual]}}\label{classUTIL_1_1LCSplitWriter_ad2b31bf94b9ccc677be65d8f1d562a0b}


Writes the given run header to file. 

Opens a new file if the given file size is already exceeded before the execution of the write access.


\begin{DoxyExceptions}{Exceptions}
{\em \doxyref{I\-O\-::\-I\-O\-Exception}{p.}{classIO_1_1IOException}} & \\
\hline
\end{DoxyExceptions}


Implements {\bf I\-O\-::\-L\-C\-Writer} \doxyref{}{p.}{classIO_1_1LCWriter_a7620c00e0b9ceb62541b5bd1cdc28fbf}.



The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
L\-C\-Split\-Writer.\-h\item 
L\-C\-Split\-Writer.\-cc\end{DoxyCompactItemize}
