ost::RandomFile(3)
π ost::RandomFile(3) π
okay bestie, welcome to the manual page for ost::RandomFile(3) from the Library Functions Manual β it's giving foundational-base-class energy and honestly? she ate β¨
πΈ NAME πΈ
ost::RandomFile β the whole point of this class is to define a base class for low level random file access that is portable between Win32 and Posix systems. π¦
β¨ SYNOPSIS β¨
#include <file.h>
Inherits ost::Mutex, and ost::File.
Inherited by ost::MappedFile, ost::SharedFile, and ost::ThreadFile.
π Public Member Functions π
virtual ~RandomFile ()β destroy a random access file or it's derived class. bye babe π«Άbool initial (void)β this method should be called right after aRandomFilederived object has been created. yes, literally right after, don't skip it πoff_t getCapacity (void)β get current file capacity.virtual Error restart (void)β this method is commonly used to close and re-open an existing database.Error getErrorNumber (void)β return current error id.char * getErrorString (void)β return current error string.bool operator! (void)β no description given, she's mysterious like that π
π Protected Member Functions π
RandomFile (const char *name=NULL)β create an unopened random access file.RandomFile (const RandomFile &rf)β default copy constructor.Error error (Error errid, char *errstr=NULL)β post an error event.Error error (char *err)β post an extended string error message.void setError (bool enable)β used to enable or disable throwing of exceptions on errors.Error setCompletion (Complete mode)β used to set file completion modes.void setTemporary (bool enable)β used to set the temporary attribute for the file.virtual Attr initialize (void)β this method is used to initialize a newly created file as indicated by the 'initial' flag.void final (void)β close the file.
π§ Protected Attributes π§
int fdAccess accesschar * pathnamestruct { unsigned count: 16; bool thrown: 1; bool initial: 1; bool immediate: 1; bool temp: 1; } flags
π Related Functions π
(Note that these are not member functions.) β yes bestie, we're still claiming them, they're part of the family π
bool __EXPORT isDir (const char *path)bool __EXPORT isFile (const char *path)bool __EXPORT isDevice (const char *path)bool __EXPORT canAccess (const char *path)bool __EXPORT canModify (const char *path)time_t __EXPORT lastModified (const char *path)time_t __EXPORT lastAccessed (const char *path)
β Additional Inherited Members β
yeah there's more stuff inherited, it's just vibing over there π¦
π 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. fr fr, that's the mission statement.
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. so like, if you're out here building database services, this is your girl. the standard C++ streaming file classes could never π
πΈ Author πΈ
David Sugar dyfet@ostel.com
Portable random disk file access. π
π Constructor & Destructor Documentation π
ost::RandomFile::RandomFile (const char * name = NULL) [protected]
Create an unopened random access file. she's not open yet, she's just existing β¨
ost::RandomFile::RandomFile (const RandomFile & rf) [protected]
Default copy constructor. copy her, she doesn't mind π«Ά
virtual ost::RandomFile::~RandomFile () [virtual]
Destroy a random access file or it's derived class. it's giving goodbye era, iconic exit π
π Member Function Documentation π
Error ost::RandomFile::error (char * err) [inline], [protected]
Post an extended string error message.
Returns errExtended. that's the return value bestie, exactly as written
Parameters err error string.
References ost::error().
Error ost::RandomFile::error (Error errid, char * errstr = NULL) [protected]
Post an error event.
Returns error code.
Parameters
erriderror code.errstrerror message string.
void ost::RandomFile::final (void) [protected]
Close the file. periodt. π
off_t ost::RandomFile::getCapacity (void)
Get current file capacity.
Returns total file size.
Error ost::RandomFile::getErrorNumber (void) [inline]
Return current error id.
Returns last error identifier set.
char* ost::RandomFile::getErrorString (void) [inline]
Return current error string.
Returns last error string set.
bool ost::RandomFile::initial (void)
This method should be called right after a RandomFile derived object has been created. This method will invoke initialize if the object is newly created, and set file access permissions appropriately.
Returns true if file had to be initialized. π
virtual Attr ost::RandomFile::initialize (void) [protected], [virtual]
This method is used to initialize a newly created file as indicated by the 'initial' 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 'Initial' method. Typically one would use this to build an empty database shell when a previously empty database file is created.
okay listen β "should never be called directly" β I said what I said, do NOT call her directly, she's got a whole Initial method as her spokesperson π
Returns access, or attrInvalid if should be removed.
bool ost::RandomFile::operator! (void)
no description here either, she's just out here existing π
virtual Error ost::RandomFile::restart (void) [virtual]
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 ost::SharedFile, and ost::ThreadFile.
Error ost::RandomFile::setCompletion (Complete mode) [protected]
Used to set file completion modes.
Returns errSuccess if okay. β¨
Parameters mode completion mode.
void ost::RandomFile::setError (bool enable) [inline], [protected]
Used to enable or disable throwing of exceptions on errors.
Parameters enable true if errors will be thrown.
void ost::RandomFile::setTemporary (bool enable) [inline], [protected]
Used to set the temporary attribute for the file. Temporary files are automatically deleted when closed. so like, she deletes herself. self-care honestly π«Ά
Parameters enable true for marking as temporary.
π¦ Friends And Related Function Documentation π¦
bool __EXPORT canAccess (const char * path)[related]bool __EXPORT canModify (const char * path)[related]bool __EXPORT isDevice (const char * path)[related]bool __EXPORT isDir (const char * path)[related]bool __EXPORT isFile (const char * path)[related]time_t __EXPORT lastAccessed (const char * path)[related]time_t __EXPORT lastModified (const char * path)[related]
yes, they're "related", not members, we already said that, but they're still invited to the party π
π§ Member Data Documentation π§
Access ost::RandomFile::access[protected]unsigned ost::RandomFile::countint ost::RandomFile::fd[protected]struct { ... } ost::RandomFile::flags[protected]bool ost::RandomFile::immediatebool ost::RandomFile::initialchar* ost::RandomFile::pathname[protected]bool ost::RandomFile::tempbool ost::RandomFile::thrown
π Author π
Generated automatically by Doxygen for GNU CommonC++ from the source code. not me being auto-generated π
and that's the whole page bestie!! π this one came from GNU CommonC++, dated Sun Dec 27 2020 β ily, go read your files randomly and portably, mwah π π
π¦ where this page comes from
- ubuntu jammy: libcommoncpp2-doc 1.8.1-10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms