Changeset 3658 in Sophya for trunk/AddOn/TAcq/minifits.h
- Timestamp:
- Oct 18, 2009, 11:10:33 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/minifits.h
r3592 r3658 3 3 4 4 #include <stdio.h> 5 #include <exception> 5 6 #include <string> 6 7 … … 14 15 using namespace std; 15 16 16 class MiniFITSException { 17 #define MFEX_MAXMSGLEN 160 18 19 class MiniFITSException : public std::exception { 17 20 public: 18 explicit MiniFITSException(const char * m) { msg = m; } 19 explicit MiniFITSException(const string& m) { msg = m; } 20 virtual ~MiniFITSException() { } 21 virtual string const& Msg() const {return msg;} 21 explicit MiniFITSException(const char * m) throw() ; 22 explicit MiniFITSException(const string& m) throw() ; 23 virtual ~MiniFITSException() throw() ; 24 //! Implementation of std::exception what() method, returning the exception message 25 virtual const char* what() const throw(); 26 virtual string const Msg() const ; 22 27 private: 23 string msg;28 char msg_[MFEX_MAXMSGLEN]; 24 29 }; 25 30 … … 68 73 { return ( Write((void *)data, nel*sizeof(Float32)) ); } 69 74 75 // Ajout de mots-cle a l'entete FITS 76 int AddKeyI(const char* key, long val, const char* comm=NULL); 77 inline int AddKeyI(string const& key, long val) 78 { return AddKeyI(key.c_str(), val); } 79 inline int AddKeyI(string const& key, long val, string const& comm) 80 { return AddKeyI(key.c_str(), val, comm.c_str()); } 81 int AddKeyD(const char* key, double val, const char* comm=NULL); 82 inline int AddKeyD(string const& key, double val) 83 { return AddKeyD(key.c_str(), val); } 84 inline int AddKeyD(string const& key, double val, string const& comm) 85 { return AddKeyD(key.c_str(), val, comm.c_str()); } 86 int AddKeyS(const char* key, const char* val, const char* comm=NULL); 87 inline int AddKeyS(string const& key, string const& val) 88 { return AddKeyS(key.c_str(), val.c_str()); } 89 inline int AddKeyS(string const& key, string const& val, string const& comm) 90 { return AddKeyS(key.c_str(), val.c_str(), comm.c_str()); } 91 70 92 // string getKey(string& key); 71 93 protected: … … 80 102 size_t totwsz; // total bytes ecrits 81 103 char* header; // entete FITS 104 int nkeya_; // 82 105 }; 83 106
Note:
See TracChangeset
for help on using the changeset viewer.