The JFile class extends the JAbstractFile class.
More...
#include <JFile.hh>
The JFile class extends the JAbstractFile class.
This class implements the JBinaryInput and JBinaryOutput interfaces.
Definition at line 26 of file JFile.hh.
◆ JFile() [1/2]
Default constructor.
Definition at line 35 of file JFile.hh.
35 :
38 {}
JAbstractFile()
Default constructor.
◆ JFile() [2/2]
Constructor.
- Parameters
-
Definition at line 46 of file JFile.hh.
◆ close()
int JLANG::JFile::close |
( |
| ) |
|
|
inline |
Close file.
- Returns
- return value
Definition at line 57 of file JFile.hh.
58 {
59 int value = -1;
60
62
64
67 }
68
69 return value;
70 }
static const int FILE_CLOSED
◆ read()
virtual int JLANG::JFile::read |
( |
char * | buffer, |
|
|
const int | length ) |
|
inlinevirtual |
◆ write()
virtual int JLANG::JFile::write |
( |
const char * | buffer, |
|
|
const int | length ) |
|
inlinevirtual |
◆ in_avail()
Check availability of input.
This method returns true if at least one byte can be read without blocking.
- Parameters
-
- Returns
- true if ready to read; else false
Definition at line 106 of file JFile.hh.
107 {
108 return JFileDescriptorMask(*this).in_avail(timeout);
109 }
◆ out_avail()
Check availability of output.
This method returns true if at least one byte can be written without blocking.
- Parameters
-
- Returns
- true if ready to write; else false
Definition at line 119 of file JFile.hh.
120 {
121 return JFileDescriptorMask(*this).out_avail(timeout);
122 }
◆ good()
virtual bool JLANG::JFile::good |
( |
| ) |
const |
|
inlinevirtual |
Check status.
- Returns
- true if last I/O operation successful; else false
Definition at line 130 of file JFile.hh.
131 {
133 }
bool is_open() const
Get open status.
virtual bool bad() const
Check status.
virtual bool eof() const
Check end of file.
◆ fail()
virtual bool JLANG::JFile::fail |
( |
| ) |
const |
|
inlinevirtual |
Check status.
- Returns
- true if last I/O operation caused logical error; else false
Definition at line 141 of file JFile.hh.
◆ bad()
virtual bool JLANG::JFile::bad |
( |
| ) |
const |
|
inlinevirtual |
Check status.
- Returns
- true if last I/O operation caused read/write error; else false
Definition at line 152 of file JFile.hh.
153 {
155 }
virtual bool fail() const
Check status.
◆ eof()
virtual bool JLANG::JFile::eof |
( |
| ) |
const |
|
inlinevirtual |
Check end of file.
- Returns
- true if end of file; else false
Definition at line 163 of file JFile.hh.
◆ less()
bool JLANG::JAbstractFile::less |
( |
const JAbstractFile & | file | ) |
const |
|
inlineinherited |
Less than operation.
- Parameters
-
- Returns
- true if this file descriptor is less; else false
Definition at line 64 of file JAbstractFile.hh.
65 {
67 }
int getFileDescriptor() const
Get file descriptor.
◆ getFileDescriptor()
int JLANG::JAbstractFile::getFileDescriptor |
( |
| ) |
const |
|
inlineinherited |
Get file descriptor.
- Returns
- file descriptor
Definition at line 75 of file JAbstractFile.hh.
◆ setFileDescriptor()
void JLANG::JAbstractFile::setFileDescriptor |
( |
const int | file | ) |
|
|
inlineinherited |
◆ is_open()
bool JLANG::JAbstractFile::is_open |
( |
| ) |
const |
|
inlineinherited |
◆ result
◆ FILE_CLOSED
const int JLANG::JAbstractFile::FILE_CLOSED = -1 |
|
staticinherited |
◆ fileDescriptor
int JLANG::JAbstractFile::fileDescriptor |
|
protectedinherited |
The documentation for this class was generated from the following file: