mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 03:00:06 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
	
		
			545 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
	
		
			545 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| #include <boost/iostreams/categories.hpp>
 | |
| #include <QIODevice>
 | |
| 
 | |
| namespace scwx
 | |
| {
 | |
| namespace qt
 | |
| {
 | |
| namespace util
 | |
| {
 | |
| 
 | |
| class IoDeviceSource
 | |
| {
 | |
| public:
 | |
|    typedef char                         char_type;
 | |
|    typedef boost::iostreams::source_tag category;
 | |
| 
 | |
|    IoDeviceSource(QIODevice& source) : source_ {source} {}
 | |
|    ~IoDeviceSource() {}
 | |
| 
 | |
|    std::streamsize read(char* buffer, std::streamsize n)
 | |
|    {
 | |
|       return source_.read(buffer, n);
 | |
|    }
 | |
| 
 | |
| private:
 | |
|    QIODevice& source_;
 | |
| };
 | |
| 
 | |
| } // namespace util
 | |
| } // namespace qt
 | |
| } // namespace scwx
 | 
