Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > by-pkgid > ad1ba1135a9c9eeffc2e538163e00373 > files > 729

libCommonC++2_1.4-devel-1.4.1-1mdv2007.0.i586.rpm

\section{ost::Random\-File Class Reference}
\label{classost_1_1_random_file}\index{ost::RandomFile@{ost::RandomFile}}
The purpose of this class is to define a base class for low level random file access that is portable between Win32 and Posix systems.Portable random disk file access.  


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

Inheritance diagram for ost::Random\-File::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3cm]{classost_1_1_random_file}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
virtual {\bf $\sim$Random\-File} ()
\begin{CompactList}\small\item\em Destroy a random access file or it's derived class. \item\end{CompactList}\item 
bool {\bf initial} (void)
\begin{CompactList}\small\item\em This method should be called right after a {\bf Random\-File}{\rm (p.\,\pageref{classost_1_1_random_file})} derived object has been created. \item\end{CompactList}\item 
off\_\-t {\bf get\-Capacity} (void)
\begin{CompactList}\small\item\em Get current file capacity. \item\end{CompactList}\item 
virtual {\bf Error} {\bf restart} (void)
\begin{CompactList}\small\item\em This method is commonly used to close and re-open an existing database. \item\end{CompactList}\item 
{\bf Error} {\bf get\-Error\-Number} (void)
\begin{CompactList}\small\item\em Return current error id. \item\end{CompactList}\item 
char $\ast$ {\bf get\-Error\-String} (void)
\begin{CompactList}\small\item\em Return current error string. \item\end{CompactList}\item 
bool {\bf operator!} (void)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
{\bf Random\-File} (const char $\ast$name=NULL)
\begin{CompactList}\small\item\em Create an unopened random access file. \item\end{CompactList}\item 
{\bf Random\-File} (const {\bf Random\-File} \&rf)
\begin{CompactList}\small\item\em Default copy constructor. \item\end{CompactList}\item 
{\bf Error} {\bf error} ({\bf Error} errid, char $\ast$errstr=NULL)
\begin{CompactList}\small\item\em Post an error event. \item\end{CompactList}\item 
{\bf Error} {\bf error} (char $\ast$err)
\begin{CompactList}\small\item\em Post an extended string error message. \item\end{CompactList}\item 
void {\bf set\-Error} (bool enable)
\begin{CompactList}\small\item\em Used to enable or disable throwing of exceptions on errors. \item\end{CompactList}\item 
{\bf Error} {\bf set\-Completion} ({\bf Complete} mode)
\begin{CompactList}\small\item\em Used to set file completion modes. \item\end{CompactList}\item 
void {\bf set\-Temporary} (bool enable)
\begin{CompactList}\small\item\em Used to set the temporary attribute for the file. \item\end{CompactList}\item 
virtual {\bf Attr} {\bf initialize} (void)
\begin{CompactList}\small\item\em This method is used to initialize a newly created file as indicated by the \char`\"{}initial\char`\"{} flag. \item\end{CompactList}\item 
void {\bf final} (void)
\begin{CompactList}\small\item\em Close the file. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
int {\bf fd}
\item 
{\bf Access} {\bf access}
\item 
char $\ast$ {\bf pathname}
\item 
\begin{tabbing}
xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=\kill
struct \{\\
\>unsigned {\bf count}: 16\\
\>bool {\bf thrown}: 1\\
\>bool {\bf initial}: 1\\
\>bool {\bf immediate}: 1\\
\>bool {\bf temp}: 1\\
\} {\bf flags}\\

\end{tabbing}\end{CompactItemize}
\subsection*{Related Functions}
(Note that these are not member functions.) \begin{CompactItemize}
\item 
bool \_\-\_\-EXPORT {\bf is\-Dir} (const char $\ast$path)
\item 
bool \_\-\_\-EXPORT {\bf is\-File} (const char $\ast$path)
\item 
bool \_\-\_\-EXPORT {\bf is\-Device} (const char $\ast$path)
\item 
bool \_\-\_\-EXPORT {\bf can\-Access} (const char $\ast$path)
\item 
bool \_\-\_\-EXPORT {\bf can\-Modify} (const char $\ast$path)
\item 
time\_\-t \_\-\_\-EXPORT {\bf last\-Modified} (const char $\ast$path)
\item 
time\_\-t \_\-\_\-EXPORT {\bf last\-Accessed} (const char $\ast$path)
\end{CompactItemize}


\subsection{Detailed Description}
The purpose of this class is to define a base class for low level random file access that is portable between Win32 and Posix systems.Portable random disk file access. 

This class is a foundation both for optimized thread shared and traditional locked file access that is commonly used to build database services, rather than the standard C++ streaming file classes.

\begin{Desc}
\item[Author:]David Sugar $<${\tt dyfet@ostel.com}$>$ \end{Desc}




\subsection{Constructor \& Destructor Documentation}
\index{ost::RandomFile@{ost::Random\-File}!RandomFile@{RandomFile}}
\index{RandomFile@{RandomFile}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Random\-File::Random\-File (const char $\ast$ {\em name} = {\tt NULL})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_random_file_bf33cf415283a29f6e81edcacd101178}


Create an unopened random access file. 

\index{ost::RandomFile@{ost::Random\-File}!RandomFile@{RandomFile}}
\index{RandomFile@{RandomFile}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Random\-File::Random\-File (const {\bf Random\-File} \& {\em rf})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_random_file_fe157c3a2b21bc1d914885b3df8f61e7}


Default copy constructor. 

\index{ost::RandomFile@{ost::Random\-File}!~RandomFile@{$\sim$RandomFile}}
\index{~RandomFile@{$\sim$RandomFile}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ost::Random\-File::$\sim$Random\-File ()\hspace{0.3cm}{\tt  [virtual]}}\label{classost_1_1_random_file_e88353b07b9a470a4bfb83f3880d11c6}


Destroy a random access file or it's derived class. 



\subsection{Member Function Documentation}
\index{ost::RandomFile@{ost::Random\-File}!error@{error}}
\index{error@{error}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Random\-File::error (char $\ast$ {\em err})\hspace{0.3cm}{\tt  [inline, protected]}}\label{classost_1_1_random_file_92df85d985d4fd0f4b272742243db7da}


Post an extended string error message. 

\begin{Desc}
\item[Returns:]err\-Extended. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em err}]error string. \end{description}
\end{Desc}
\index{ost::RandomFile@{ost::Random\-File}!error@{error}}
\index{error@{error}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Random\-File::error ({\bf Error} {\em errid}, char $\ast$ {\em errstr} = {\tt NULL})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_random_file_a82c1311e24dd37063c05629c29d51e6}


Post an error event. 

\begin{Desc}
\item[Returns:]error code. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em errid}]error code. \item[{\em errstr}]error message string. \end{description}
\end{Desc}
\index{ost::RandomFile@{ost::Random\-File}!final@{final}}
\index{final@{final}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void ost::Random\-File::final (void)\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_random_file_0013f73f6551540a4d8acb2f53092d2d}


Close the file. 

\index{ost::RandomFile@{ost::Random\-File}!getCapacity@{getCapacity}}
\index{getCapacity@{getCapacity}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}off\_\-t ost::Random\-File::get\-Capacity (void)}\label{classost_1_1_random_file_ed24526ff016216a57a179dfa7c1a70e}


Get current file capacity. 

\begin{Desc}
\item[Returns:]total file size. \end{Desc}
\index{ost::RandomFile@{ost::Random\-File}!getErrorNumber@{getErrorNumber}}
\index{getErrorNumber@{getErrorNumber}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Random\-File::get\-Error\-Number (void)\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_random_file_4c6b37d6c510619a3988eb2024e5596e}


Return current error id. 

\begin{Desc}
\item[Returns:]last error identifier set. \end{Desc}
\index{ost::RandomFile@{ost::Random\-File}!getErrorString@{getErrorString}}
\index{getErrorString@{getErrorString}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ ost::Random\-File::get\-Error\-String (void)\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_random_file_161d0a323f1493fb241537c780ea50d3}


Return current error string. 

\begin{Desc}
\item[Returns:]last error string set. \end{Desc}
\index{ost::RandomFile@{ost::Random\-File}!initial@{initial}}
\index{initial@{initial}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool {\bf ost::Random\-File::initial} (void)}\label{classost_1_1_random_file_99c99374d066bb3ccc04e6469df6c737}


This method should be called right after a {\bf Random\-File}{\rm (p.\,\pageref{classost_1_1_random_file})} derived object has been created. 

This method will invoke initialize if the object is newly created, and set file access permissions appropriately.

\begin{Desc}
\item[Returns:]true if file had to be initialized. \end{Desc}
\index{ost::RandomFile@{ost::Random\-File}!initialize@{initialize}}
\index{initialize@{initialize}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf Attr} ost::Random\-File::initialize (void)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classost_1_1_random_file_76af824e4cd76326652b6d84af1651b9}


This method is used to initialize a newly created file as indicated by the \char`\"{}initial\char`\"{} flag. 

This method also returns the file access permissions that should be associated with the file. This method should never be called directly, but is instead used to impliment the \char`\"{}Initial\char`\"{} method. Typically one would use this to build an empty database shell when a previously empty database file is created.

\begin{Desc}
\item[Returns:]access, or attr\-Invalid if should be removed. \end{Desc}
\index{ost::RandomFile@{ost::Random\-File}!operator"!@{operator"!}}
\index{operator"!@{operator"!}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool ost::Random\-File::operator! (void)}\label{classost_1_1_random_file_c6efd8f7cd9f643c9986a1b4bb537240}


\index{ost::RandomFile@{ost::Random\-File}!restart@{restart}}
\index{restart@{restart}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf Error} ost::Random\-File::restart (void)\hspace{0.3cm}{\tt  [virtual]}}\label{classost_1_1_random_file_e78c71b1e3fab5861bc9fdae595829a7}


This method is commonly used to close and re-open an existing database. 

This may be used when the database has been unlinked and an external process provides a new one to use. 

Reimplemented in {\bf ost::Thread\-File} {\rm (p.\,\pageref{classost_1_1_thread_file_634eeae5f8e783d26e484046344a0556})}, and {\bf ost::Shared\-File} {\rm (p.\,\pageref{classost_1_1_shared_file_254c43de705b9ad9f5d24536b6cff1e0})}.\index{ost::RandomFile@{ost::Random\-File}!setCompletion@{setCompletion}}
\index{setCompletion@{setCompletion}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Random\-File::set\-Completion ({\bf Complete} {\em mode})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_random_file_cc54d7bb92ff3d5856c89bdf146d27fa}


Used to set file completion modes. 

\begin{Desc}
\item[Returns:]err\-Success if okay. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mode}]completion mode. \end{description}
\end{Desc}
\begin{Desc}
\item[{\bf Todo}]implement in win32 \end{Desc}
\index{ost::RandomFile@{ost::Random\-File}!setError@{setError}}
\index{setError@{setError}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void ost::Random\-File::set\-Error (bool {\em enable})\hspace{0.3cm}{\tt  [inline, protected]}}\label{classost_1_1_random_file_f8205a0d1592268c7de8212c7c5d38b1}


Used to enable or disable throwing of exceptions on errors. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em enable}]true if errors will be thrown. \end{description}
\end{Desc}
\index{ost::RandomFile@{ost::Random\-File}!setTemporary@{setTemporary}}
\index{setTemporary@{setTemporary}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void ost::Random\-File::set\-Temporary (bool {\em enable})\hspace{0.3cm}{\tt  [inline, protected]}}\label{classost_1_1_random_file_429480dd369c4058a8af0cc8ec91866a}


Used to set the temporary attribute for the file. 

Temporary files are automatically deleted when closed.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em enable}]true for marking as temporary. \end{description}
\end{Desc}


\subsection{Friends And Related Function Documentation}
\index{ost::RandomFile@{ost::Random\-File}!canAccess@{canAccess}}
\index{canAccess@{canAccess}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool \_\-\_\-EXPORT can\-Access (const char $\ast$ {\em path})\hspace{0.3cm}{\tt  [related]}}\label{classost_1_1_random_file_45b667dac523788084f05447ce10c9b6}


\index{ost::RandomFile@{ost::Random\-File}!canModify@{canModify}}
\index{canModify@{canModify}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool \_\-\_\-EXPORT can\-Modify (const char $\ast$ {\em path})\hspace{0.3cm}{\tt  [related]}}\label{classost_1_1_random_file_c5e2c1d709a2eb2f9301bcff74594997}


\index{ost::RandomFile@{ost::Random\-File}!isDevice@{isDevice}}
\index{isDevice@{isDevice}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool \_\-\_\-EXPORT is\-Device (const char $\ast$ {\em path})\hspace{0.3cm}{\tt  [related]}}\label{classost_1_1_random_file_aaed88405b79b6913bae1483c15bb46f}


\index{ost::RandomFile@{ost::Random\-File}!isDir@{isDir}}
\index{isDir@{isDir}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool \_\-\_\-EXPORT is\-Dir (const char $\ast$ {\em path})\hspace{0.3cm}{\tt  [related]}}\label{classost_1_1_random_file_53ba9695ddea1583753004db938fa631}


\index{ost::RandomFile@{ost::Random\-File}!isFile@{isFile}}
\index{isFile@{isFile}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool \_\-\_\-EXPORT is\-File (const char $\ast$ {\em path})\hspace{0.3cm}{\tt  [related]}}\label{classost_1_1_random_file_c25c8ba76b0412251d209292768db1b4}


\index{ost::RandomFile@{ost::Random\-File}!lastAccessed@{lastAccessed}}
\index{lastAccessed@{lastAccessed}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}time\_\-t \_\-\_\-EXPORT last\-Accessed (const char $\ast$ {\em path})\hspace{0.3cm}{\tt  [related]}}\label{classost_1_1_random_file_5618d9c5f79d0b7d3a82fac1eb02b84d}


\index{ost::RandomFile@{ost::Random\-File}!lastModified@{lastModified}}
\index{lastModified@{lastModified}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}time\_\-t \_\-\_\-EXPORT last\-Modified (const char $\ast$ {\em path})\hspace{0.3cm}{\tt  [related]}}\label{classost_1_1_random_file_52af42981942dcbecaa13657fc4b3095}




\subsection{Member Data Documentation}
\index{ost::RandomFile@{ost::Random\-File}!access@{access}}
\index{access@{access}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Access} {\bf ost::Random\-File::access}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_random_file_36f63b4d57f5f789f4ec3cade258ceba}


\index{ost::RandomFile@{ost::Random\-File}!count@{count}}
\index{count@{count}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned {\bf ost::Random\-File::count}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_random_file_eda3247665dcab25eadc6c1cda60f035}


\index{ost::RandomFile@{ost::Random\-File}!fd@{fd}}
\index{fd@{fd}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf ost::Random\-File::fd}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_random_file_bc91558a45f6d8c78165625e01addc0c}


\index{ost::RandomFile@{ost::Random\-File}!flags@{flags}}
\index{flags@{flags}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}struct \{ ... \}   {\bf ost::Random\-File::flags}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_random_file_a9789125bc044e47c0b8af992e25475a}


\index{ost::RandomFile@{ost::Random\-File}!immediate@{immediate}}
\index{immediate@{immediate}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool {\bf ost::Random\-File::immediate}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_random_file_7b1672a1fbe2f99bee46abd9f725a3ef}


\index{ost::RandomFile@{ost::Random\-File}!initial@{initial}}
\index{initial@{initial}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool {\bf ost::Random\-File::initial}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_random_file_f02ec49a4e28eeb3eefd76926ff18857}


\index{ost::RandomFile@{ost::Random\-File}!pathname@{pathname}}
\index{pathname@{pathname}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ {\bf ost::Random\-File::pathname}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_random_file_564788b0bea48ae7ea0155a5bf01be31}


\index{ost::RandomFile@{ost::Random\-File}!temp@{temp}}
\index{temp@{temp}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool {\bf ost::Random\-File::temp}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_random_file_73521e78146eebab7d971975ee909739}


\index{ost::RandomFile@{ost::Random\-File}!thrown@{thrown}}
\index{thrown@{thrown}!ost::RandomFile@{ost::Random\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool {\bf ost::Random\-File::thrown}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_random_file_289ffc07e73dcb9498f94bbf4fba850e}




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