USGS

Isis 3.0 Object Programmers' Reference

Home

TableField.h
Go to the documentation of this file.
1 #ifndef TableField_h
2 #define TableField_h
3 
25 #include <vector>
26 
27 #include <QString>
28 
29 namespace Isis {
30  class PvlGroup;
63  class TableField {
64  public:
68  enum Type {
71  Text,
74  };
75 
76  //Constructors and Destructor
77  TableField(const QString &name, Type type, int size = 1);
78  TableField(PvlGroup &field);
79  ~TableField();
80 
81 
82  QString name() const;
83  Type type() const;
84  bool isInteger() const;
85  bool isDouble() const;
86  bool isText() const;
87  bool isReal() const;
88  int bytes() const;
89  int size() const;
90 
91  operator int() const;
92  operator double() const;
93  operator float() const;
94  operator QString() const;
95  operator std::vector<int>() const;
96  operator std::vector<double>() const;
97  operator std::vector<float>() const;
98 
99  void operator=(const int value);
100  void operator=(const double value);
101  void operator=(const float value);
102  void operator=(const QString &value);
103  void operator=(const std::vector<int> &values);
104  void operator=(const std::vector<double> &values);
105  void operator=(const std::vector<float> &value);
106  void operator=(const char *buf);
107  void operator=(const void *buf);
108 
109  PvlGroup pvlGroup();
110 
111  static QString toString(const TableField &field, QString delimiter = ",");
112 
113  private:
114  QString m_name;
116  int m_size;
118  int m_bytes;
119  std::vector<int> m_ivalues;
122  std::vector<double> m_dvalues;
125  std::vector<float> m_rvalues;
128  QString m_svalue;
131  };
132 };
133 
134 #endif