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