FreeNOS
Public Member Functions
LogLevelFile Class Reference

Provides a File abstraction of the current Log::Level. More...

#include <LogLevelFile.h>

Inheritance diagram for LogLevelFile:
File

Public Member Functions

 LogLevelFile (const u32 inode)
 Default constructor. More...
 
virtual ~LogLevelFile ()
 Destructor. More...
 
virtual FileSystem::Result read (IOBuffer &buffer, Size &size, const Size offset)
 Read bytes from the file. More...
 
virtual FileSystem::Result write (IOBuffer &buffer, Size &size, const Size offset)
 Write bytes to the file. More...
 
- Public Member Functions inherited from File
 File (const u32 inode, const FileSystem::FileType type=FileSystem::RegularFile, const UserID uid=ZERO, const GroupID gid=ZERO)
 Constructor function. More...
 
virtual ~File ()
 Destructor function. More...
 
u32 getInode () const
 Get inode number. More...
 
FileSystem::FileType getType () const
 Retrieve our filetype. More...
 
virtual FileSystem::Result status (FileSystem::FileStat &st)
 Retrieve file statistics. More...
 
virtual bool canRead () const
 Check if the File has data ready for reading. More...
 
virtual bool canWrite () const
 Check if the File can be written to. More...
 

Additional Inherited Members

- Protected Attributes inherited from File
const u32 m_inode
 Inode number. More...
 
const FileSystem::FileType m_type
 Type of this file. More...
 
UserID m_uid
 Owner of the file. More...
 
GroupID m_gid
 Group of the file. More...
 
FileSystem::FileModes m_access
 Access permissions. More...
 
Size m_size
 Size of the file, in bytes. More...
 

Detailed Description

Provides a File abstraction of the current Log::Level.

Definition at line 35 of file LogLevelFile.h.

Constructor & Destructor Documentation

◆ LogLevelFile()

LogLevelFile::LogLevelFile ( const u32  inode)

Default constructor.

Parameters
inodeInode number for this File

Definition at line 22 of file LogLevelFile.cpp.

References File::m_access, and FileSystem::OwnerRW.

◆ ~LogLevelFile()

LogLevelFile::~LogLevelFile ( )
virtual

Destructor.

Definition at line 28 of file LogLevelFile.cpp.

Member Function Documentation

◆ read()

FileSystem::Result LogLevelFile::read ( IOBuffer buffer,
Size size,
const Size  offset 
)
virtual

Read bytes from the file.

Parameters
bufferInput/Output buffer to output bytes to.
sizeMaximum number of bytes to read on input. On output, the actual number of bytes read.
offsetOffset inside the file to start reading.
Returns
Result code

Reimplemented from File.

Definition at line 32 of file LogLevelFile.cpp.

References Log::getMinimumLogLevel(), WeakSingleton< Log >::instance(), String::set(), FileSystem::Success, and IOBuffer::write().

◆ write()

FileSystem::Result LogLevelFile::write ( IOBuffer buffer,
Size size,
const Size  offset 
)
virtual

Write bytes to the file.

Parameters
bufferInput/Output buffer to input bytes from.
sizeMaximum number of bytes to write on input. On output, the actual number of bytes written.
offsetOffset inside the file to start writing.
Returns
Result code

Reimplemented from File.

Definition at line 60 of file LogLevelFile.cpp.

References WeakSingleton< Log >::instance(), IOBuffer::read(), Log::setMinimumLogLevel(), FileSystem::Success, and String::toLong().


The documentation for this class was generated from the following files: