Input file stream buffer.  
 More...
#include <JFileStreamBuffer.hh>
Input file stream buffer. 
Definition at line 25 of file JFileStreamBuffer.hh.
 
◆ int_type
◆ JFileInputStreamBuffer() [1/3]
  
  
      
        
          | JLANG::JFileInputStreamBuffer::JFileInputStreamBuffer  | 
          ( | 
          const JAbstractFile & |           file,  | 
         
        
           | 
           | 
          const std::size_t |           size = 65536,  | 
         
        
           | 
           | 
          const std::size_t |           put_back = 8 ) | 
         
       
   | 
  
inline   | 
  
 
Constructor. 
- Parameters
 - 
  
    | file | file  | 
    | size | size of internal buffer  | 
    | put_back | number of put back characters  | 
  
   
Definition at line 42 of file JFileStreamBuffer.hh.
   44                                                            :
   47    {
   48      resize(size + put_back),
   49 
   51    }
 
 
 
◆ JFileInputStreamBuffer() [2/3]
◆ JFileInputStreamBuffer() [3/3]
◆ underflow()
  
  
      
        
          | virtual int_type JLANG::JFileInputStreamBuffer::underflow  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlineoverridevirtual   | 
  
 
Check underflow. 
This method reads as many bytes as possible.
- Returns
 - first character if OK; else EOF 
 
Definition at line 60 of file JFileStreamBuffer.hh.
   61    {   
   62      if (gptr() >= egptr()) {
   63 
   64        char* __begin = this->
data();
 
   65 
   66        if (eback() == __begin) { 
   67          
   68          
   69 
   71        
   73        }
   74        
   75        const size_t len = 
in.
read(__begin, this->size() - (__begin - this->
data()));
 
   76        
   77        if (len != 0)
   78          setg(this->
data(), __begin, __begin + len);
 
   79        else
   80          return traits_type::eof();
   81      }
   82        
   83      return *gptr();
   84    } 
virtual int read(char *buffer, const int length)
Read data from file.
 
 
 
 
◆ 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 94 of file JFileStreamBuffer.hh.
   95    {
   96      return JFileDescriptorMask(
in).in_avail(timeout);
 
   97    }
 
 
 
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ in
  
  
      
        
          | JFile JLANG::JFileInputStreamBuffer::in | 
         
       
   | 
  
protected   | 
  
 
 
◆ memory
  
  
      
        
          | std::size_t JLANG::JFileInputStreamBuffer::memory | 
         
       
   | 
  
protected   | 
  
 
 
The documentation for this class was generated from the following file: