39 #define G_INSERT "GFitsTableStringCol::insert(int&, int&)"
40 #define G_REMOVE "GFitsTableStringCol::remove(int&, int&)"
137 if (
this != &column) {
329 int length = m_length +
nrows;
335 std::string* new_data =
new std::string[
m_size];
342 int n_after =
m_number * (m_length - row);
345 std::string* src =
m_data;
346 std::string* dst = new_data;
347 for (
int i = 0; i < n_before; ++i) {
350 for (
int i = 0; i < n_insert; ++i) {
354 for (
int i = 0; i < n_after; ++i) {
396 if (nrows < 0 || nrows >
m_length-row) {
418 std::string* new_data =
new std::string[
m_size];
425 int n_after =
m_number * (length - row);
428 std::string* src =
m_data;
429 std::string* dst = new_data;
430 for (
int i = 0; i < n_before; ++i) {
434 for (
int i = 0; i < n_after; ++i) {
549 for (
int i = 0; i <
m_size; ++i) {
562 #if defined(G_SMALL_MEMORY)
619 for (
int i = 0; i <
m_size; ++i) {
620 if (
m_data[i].length() > 0) {
704 for (
int i = 0; i <
m_size; ++i) {
743 std::string* dst =
m_data + index;
746 for (
int i = 0; i < num; ++i) {
760 std::string* new_data =
new std::string[
m_size];
761 std::string* dst = new_data;
762 std::string* src =
m_data;
763 for (
int i = 0; i < index; ++i) {
766 for (
int i = 0; i <
number; ++i) {
769 for (
int i = 0; i <
left; ++i) {
815 for (
int j = 0; j <=
m_width; ++j) {
834 for (
int i = 0; i <
m_size; ++i) {
855 for (
int i = 0; i <
m_size; ++i) {
862 for (
int i = 0; i <
m_size; ++i) {
863 for (
int j = 0; j <=
m_width; ++j) {
883 for (
int i = 0; i <
m_size; ++i) {
char ** m_buffer
Data area for CFITSIO transfer.
GFitsTableStringCol(void)
Constructor.
std::string number(const std::string &noun, const int &number)
Convert singular noun into number noun.
void free_buffer(void) const
Free CFITSIO transfer buffer.
int m_number
Number of elements in column.
char * nulval(void)
Returns pointer to nul value.
void free_members(void)
Delete class members.
GFitsTableCol & operator=(const GFitsTableCol &column)
Assignment operator.
std::string * m_data
Data area.
int m_varlen
Maximum number of elements in variable-length.
virtual void clear(void)
Clear instance.
char * m_nulval
NULL string.
virtual void fetch_data(void) const
Fetch column data.
virtual ~GFitsTableStringCol(void)
Destructor.
virtual void load_column(void)
Load table column from FITS file.
FITS table string column.
const int & number(void) const
Returns number of elements in column.
virtual void init_data(void)
Initialise column data.
void init_members(void)
Initialise class members.
virtual void save(void)
Save table column into FITS file.
virtual void resize_data(const int &index, const int &number)
Resize column data.
CFITSIO interface header.
Abstract interface for FITS table column.
virtual void remove(const int &row, const int &nrows)
Remove rows from column.
std::vector< int > m_rowstart
Start index of each row.
std::string left(const std::string &s, const int &n, const char &c= ' ')
Left justify string to achieve a length of n characters.
FITS table string column class interface definition.
virtual void alloc_data(void)
Allocates column data.
virtual std::string string(const int &row, const int &col=0) const
Get string value.
virtual int integer(const int &row, const int &col=0) const
Get integer value.
void alloc_nulval(const std::string &value)
Allocate nul value.
virtual std::string ascii_format(void) const
Returns format string of ASCII table.
int m_length
Length of column (number of rows)
GFitsTableStringCol & operator=(const GFitsTableStringCol &column)
Assignment operator.
int m_size
Size of allocated data area (0 if not loaded)
virtual void release_data(void)
Release column data.
virtual int offset(const int &row, const int &inx) const
Compute offset of column element in memory.
Exception handler interface definition.
virtual bool is_loaded(void) const
Checks if column has been loaded.
void free_members(void)
Delete class members.
void alloc_buffer(void) const
Allocate CFITSIO transfer buffer.
virtual double real(const int &row, const int &col=0) const
Get double precision value.
int toint(const std::string &arg)
Convert string into integer value.
virtual void save_column(void)
Save table column into FITS file.
const int & nrows(void) const
Returns number of rows in column.
virtual void insert(const int &row, const int &nrows)
Insert rows in column.
virtual GFitsTableStringCol * clone(void) const
Clone column.
double todouble(const std::string &arg)
Convert string into double precision value.
std::string & operator()(const int &row, const int &inx=0)
Column data access operator.
int m_width
Width in Bytes of single column element.
void copy_members(const GFitsTableStringCol &column)
Copy class members.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
void init_members(void)
Initialise class members.