mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 04:30:05 +00:00 
			
		
		
		
	Enable loading color palettes from embedded Qt resources
This commit is contained in:
		
							parent
							
								
									1f9392e9f6
								
							
						
					
					
						commit
						1d597eb120
					
				
					 8 changed files with 88 additions and 9 deletions
				
			
		
							
								
								
									
										32
									
								
								scwx-qt/source/scwx/qt/util/file.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								scwx-qt/source/scwx/qt/util/file.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,32 @@ | |||
| #include <scwx/qt/util/file.hpp> | ||||
| #include <scwx/qt/util/q_file_input_stream.hpp> | ||||
| 
 | ||||
| #include <fstream> | ||||
| 
 | ||||
| #include <QFile> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
| { | ||||
| namespace util | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = "scwx::qt::util::file"; | ||||
| 
 | ||||
| std::unique_ptr<std::istream> OpenFile(const std::string&      filename, | ||||
|                                        std::ios_base::openmode mode) | ||||
| { | ||||
|    if (filename.starts_with(':')) | ||||
|    { | ||||
|       return std::make_unique<QFileInputStream>(filename, mode); | ||||
|    } | ||||
|    else | ||||
|    { | ||||
|       return std::make_unique<std::ifstream>(filename, mode); | ||||
|    } | ||||
| } | ||||
| 
 | ||||
| } // namespace util
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat