mirror of
				https://github.com/davidgiven/fluxengine.git
				synced 2025-10-24 11:11:02 -07:00 
			
		
		
		
	support for validating ImageSpecs before we actually want to read/write an image, so as to allow us to check the extension *before* wasting time reading a disk. Make .d81 an alias of .img.
		
			
				
	
	
		
			44 lines
		
	
	
		
			779 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			779 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #ifndef GLOBALS_H
 | |
| #define GLOBALS_H
 | |
| 
 | |
| #include <stddef.h>
 | |
| #include <functional>
 | |
| #include <iostream>
 | |
| #include <map>
 | |
| #include <memory>
 | |
| #include <sstream>
 | |
| #include <string>
 | |
| #include <vector>
 | |
| #include <set>
 | |
| #include <cassert>
 | |
| 
 | |
| typedef int nanoseconds_t;
 | |
| class Bytes;
 | |
| 
 | |
| extern double getCurrentTime();
 | |
| extern void hexdump(std::ostream& stream, const Bytes& bytes);
 | |
| extern void hexdumpForSrp16(std::ostream& stream, const Bytes& bytes);
 | |
| 
 | |
| class Error
 | |
| {
 | |
| public:
 | |
|     [[ noreturn ]] ~Error()
 | |
|     {
 | |
|         std::cerr << "Error: " << _stream.str() << std::endl;
 | |
|         exit(1);
 | |
|     }
 | |
| 
 | |
|     template <typename T>
 | |
|     Error& operator<<(T&& t)
 | |
|     {
 | |
|         _stream << t;
 | |
|         return *this;
 | |
|     }
 | |
| 
 | |
| private:
 | |
|     std::stringstream _stream;
 | |
| };
 | |
| 
 | |
| 
 | |
| #endif
 |