Isis Developer Reference
Column.h
Go to the documentation of this file.
1#ifndef Column_h
2#define Column_h
3
9/* SPDX-License-Identifier: CC0-1.0 */
10
11#include <vector>
12
13#include <QString>
14
15namespace Isis {
39 class Column {
40 public:
41
45 enum Align {
46 NoAlign = 0,
47 Right = 1,
48 Left = 2,
49 Decimal = 3
50 };
51
55 enum Type {
56 NoType = 0,
57 Integer = 1,
58 Real = 2,
59 String = 3,
60 Pixel = 4
61 };
62
63 Column();
64 Column(QString name, int width, Column::Type type, Column::Align align = Right);
65 void SetName(QString name);
66 void SetWidth(unsigned int width);
67 void SetType(Column::Type type);
68 void SetAlignment(Column::Align alignment);
69 void SetPrecision(unsigned int precision);
70
71 QString Name() const;
72 unsigned int Width() const;
73 Column::Type DataType() const;
75 unsigned int Precision() const;
76
77
78 private:
80 QString p_name;
81
83 unsigned int p_width;
84
86 Column::Type p_type;
87
89 Column::Align p_align;
90
92 unsigned int p_precision;
93 };
94};
95
96#endif
Format ascii tables.
Definition Column.h:39
QString Name() const
Get the Column's name.
Definition Column.cpp:133
Align
Alignment of data in the Column.
Definition Column.h:45
@ NoAlign
no alignment
Definition Column.h:46
@ Right
right alignment
Definition Column.h:47
@ Decimal
decimal alignment
Definition Column.h:49
@ Left
left alignment
Definition Column.h:48
void SetName(QString name)
Sets the Column name, or header.
Definition Column.cpp:55
Column::Type DataType() const
Returns the type of data this column will contain.
Definition Column.cpp:152
unsigned int Precision() const
Get the Column's precision.
Definition Column.cpp:172
Column()
Constructor.
Definition Column.cpp:20
Column::Align Alignment() const
Get the Column's alignment.
Definition Column.cpp:162
unsigned int Width() const
Get the Column's width.
Definition Column.cpp:142
void SetWidth(unsigned int width)
Sets the width of the Column, in text columns.
Definition Column.cpp:68
void SetPrecision(unsigned int precision)
Sets the precision of the Column, for real number values.
Definition Column.cpp:119
void SetType(Column::Type type)
Sets the data type of the Column.
Definition Column.cpp:82
Type
Type of data in the Column.
Definition Column.h:55
@ Real
Integer data type.
Definition Column.h:58
@ Integer
No data type.
Definition Column.h:57
@ NoType
Definition Column.h:56
@ String
Real data type.
Definition Column.h:59
void SetAlignment(Column::Align alignment)
Sets the alignment of the Column.
Definition Column.cpp:101
Store and/or manipulate pixel values.
Definition Pixel.h:48
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16