00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef KEYWORDCREATOR_H
00010 #define KEYWORDCREATOR_H 1
00011
00012
00013 #include "KeyData.h"
00014
00015 #include "FitsError.h"
00016
00017 namespace CCfits {
00018 class HDU;
00019
00020 }
00021
00022
00023 namespace CCfits {
00024
00025
00026
00027 class KeywordCreator
00028 {
00029
00030 public:
00031 KeywordCreator (HDU* p);
00032 virtual ~KeywordCreator();
00033
00034 virtual Keyword* MakeKeyword (const String& keyName, const String& comment = String("")) = 0;
00035 static Keyword* getKeyword (const String& keyName, HDU* p);
00036
00037 virtual void reset ();
00038 virtual Keyword* createKeyword (const String& keyName, const String& comment = String(""));
00039
00040
00041 static Keyword* getKeyword (const String& keyName, ValueType keyType, HDU* p);
00042 static Keyword* getKeyword (int keyNumber, HDU* p);
00043
00044
00045
00046 protected:
00047 HDU* forHDU ();
00048
00049
00050
00051 private:
00052 KeywordCreator(const KeywordCreator &right);
00053 KeywordCreator & operator=(const KeywordCreator &right);
00054
00055 static Keyword* parseRecord (const String& name, const String& valueString, const String& comment, HDU* hdu);
00056 static bool isContinued (const String& value);
00057 static void getLongValueString (HDU* p, const String& keyName, String& value);
00058
00059
00060
00061 private:
00062
00063 Keyword *m_keyword;
00064
00065
00066 HDU* m_forHDU;
00067
00068
00069
00070 };
00071
00072
00073
00074 inline void KeywordCreator::reset ()
00075 {
00076 m_keyword=0;
00077
00078 }
00079
00080 inline HDU* KeywordCreator::forHDU ()
00081 {
00082 return m_forHDU;
00083 }
00084
00085 }
00086
00087
00088 #endif