Branch data Line data Source code
1 : : /* 2 : : =============================================================================== 3 : : 4 : : FILE: excepts.hpp 5 : : 6 : : CONTENTS: 7 : : Exception types 8 : : 9 : : PROGRAMMERS: 10 : : 11 : : martin.isenburg@rapidlasso.com - http://rapidlasso.com 12 : : uday.karan@gmail.com - Hobu, Inc. 13 : : 14 : : COPYRIGHT: 15 : : 16 : : (c) 2007-2014, martin isenburg, rapidlasso - tools to catch reality 17 : : (c) 2014, Uday Verma, Hobu, Inc. 18 : : 19 : : This is free software; you can redistribute and/or modify it under the 20 : : terms of the GNU Lesser General Licence as published by the Free Software 21 : : Foundation. See the COPYING file for more information. 22 : : 23 : : This software is distributed WITHOUT ANY WARRANTY and without even the 24 : : implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 : : 26 : : CHANGE HISTORY: 27 : : 28 : : =============================================================================== 29 : : */ 30 : : 31 : : #ifndef __excepts_hpp__ 32 : : #define __excepts_hpp__ 33 : : 34 : : #include <stdexcept> 35 : : 36 : : namespace laszip { 37 : : #define __make_exception_class(name,msg) \ 38 : : struct name : public std::runtime_error { name() : std::runtime_error(msg) {} } 39 : : 40 : : __make_exception_class(file_not_found, "The specified file was not found"); 41 : 0 : __make_exception_class(invalid_magic, "File magic is not valid"); 42 : 0 : __make_exception_class(old_style_compression, "The file seems to have old style compression which is not supported"); 43 : 0 : __make_exception_class(not_compressed, "The file doesn't seem to be compressed"); 44 : : 45 : : __make_exception_class(invalid_header_request, "Cannot request for headers while the file state in invalid"); 46 : : 47 : 0 : __make_exception_class(no_laszip_vlr, "No LASzip VLR was found in the VLRs section"); 48 : 0 : __make_exception_class(laszip_format_unsupported, "Only LASzip POINTWISE CHUNKED decompressor is supported"); 49 : : 50 : 0 : __make_exception_class(chunk_table_read_error, "There was a problem reading the chunk table"); 51 : 0 : __make_exception_class(unknown_chunk_table_format, "The chunk table version number is unknown"); 52 : : 53 : 0 : __make_exception_class(unknown_schema_type, "The LAZ schema is not recognized"); 54 : : __make_exception_class(unknown_record_item_type, "The record item type is not supported"); 55 : : 56 : : __make_exception_class(write_open_failed, "Could not open file for writing"); 57 : : 58 : 0 : __make_exception_class(end_of_file, "Reached End of file"); 59 : : 60 : : 61 : 0 : struct not_supported : public std::runtime_error { 62 : 0 : not_supported(const char *msg) : std::runtime_error(msg) { } 63 : : }; 64 : : } 65 : : 66 : : #endif // __excepts_hpp__