1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
// Astrophysics Science Division,
// NASA/ Goddard Space Flight Center
// HEASARC
// http://heasarc.gsfc.nasa.gov
// e-mail: ccfits@legacy.gsfc.nasa.gov
//
// Original author: Ben Dorman
#ifndef KEYWORDCREATOR_H
#define KEYWORDCREATOR_H 1
// KeyData
#include "KeyData.h"
// FitsError
#include "FitsError.h"
namespace CCfits {
class HDU;
} // namespace CCfits
namespace CCfits {
class KeywordCreator
{
public:
KeywordCreator (HDU* p);
virtual ~KeywordCreator();
virtual Keyword* MakeKeyword (const String& keyName, const String& comment = String("")) = 0;
static Keyword* getKeyword (const String& keyName, HDU* p);
// Additional Public Declarations
virtual void reset ();
virtual Keyword* createKeyword (const String& keyName, const String& comment = String(""));
// This version of getKeyword is for reading a keyword
// in with a specified type.
static Keyword* getKeyword (const String& keyName, ValueType keyType, HDU* p);
static Keyword* getKeyword (int keyNumber, HDU* p);
// If calling function already has the keyword name, it can send it in as the
// 3rd argument and the function will make use of it. Otherwise leave it
// empty and the function will just extract the keyword name from the card.
// This function does not take ownership of the memory allocated to card.
static Keyword* getKeywordFromCard(char* card, HDU* p, const String& keyName=string(""));
// Additional Public Declarations
protected:
HDU* forHDU ();
// Additional Protected Declarations
private:
KeywordCreator(const KeywordCreator &right);
KeywordCreator & operator=(const KeywordCreator &right);
static Keyword* parseRecord (const String& name, const String& valueString, const String& comment, HDU* hdu);
static bool isContinued (const String& value);
static void getLongValueString (HDU* p, const String& keyName, String& value);
// Additional Private Declarations
private: //## implementation
// Data Members for Class Attributes
Keyword *m_keyword;
// Data Members for Associations
HDU* m_forHDU;
// Additional Implementation Declarations
};
// Class CCfits::KeywordCreator
inline void KeywordCreator::reset ()
{
m_keyword=0;
}
inline HDU* KeywordCreator::forHDU ()
{
return m_forHDU;
}
} // namespace CCfits
#endif
|