casacore
Loading...
Searching...
No Matches

Helper class for readAsciiTable. More...

#include <ReadAsciiTable.h>

Static Public Member Functions

static String run (const String &headerfile, const String &filein, const String &tableproto, const String &tablename, Bool autoHeader, const IPosition &autoShape, const Vector< String > &columnNames, const Vector< String > &dataTypes, Char separator, const String &commentMarkerRegex, Int firstLine, Int lastLine)
 Run the readAsciiTable.
static Table runt (String &formatString, Table::TableType tableType, const String &headerfile, const String &filein, const String &tableproto, const String &tablename, Bool autoHeader, const IPosition &autoShape, const Vector< String > &columnNames, const Vector< String > &dataTypes, Char separator, const String &commentMarkerRegex, Int firstLine, Int lastLine)
static double stringToPos (const String &pos, Bool isDMS)
 Read a position using MVAngle.

Private Types

enum  RATType {
  RATBool ,
  RATShort ,
  RATInt ,
  RATFloat ,
  RATDouble ,
  RATString ,
  RATComX ,
  RATComZ ,
  RATDComX ,
  RATDComZ ,
  RATDMS ,
  RATHMS
}
 Define types. More...

Static Private Member Functions

static String doRun (const String &headerfile, const String &filein, const String &tableproto, const String &tablename, Bool autoHeader, const IPosition &autoShape, const Vector< String > &columnNames, const Vector< String > &dataTypes, Char separator, Bool testComment, const Regex &commentMarker, Int firstLine, Int lastLine)
 Do the actual run.
static Table makeTab (String &formatString, Table::TableType tableType, const String &headerfile, const String &filein, const String &tableproto, const String &tablename, Bool autoHeader, const IPosition &autoShape, const Vector< String > &columnNames, const Vector< String > &dataTypes, Char separator, Bool testComment, const Regex &commentMarker, Int firstLine, Int lastLine)
 Do the actual work of making and filling the table.
static Bool getLine (ifstream &file, Int &lineNumber, char *line, Int lineSize, Bool testComment, const Regex &commentMarker, Int firstLine, Int lastLine)
 Get the next line.
static Int getNext (const Char *string, Int strlen, Char *result, Int &at, Char separator)
 Get the next part of the line using the separator as delimiter.
static void getTypes (const IPosition &shape, const Char *in, Int leng, Char *string1, Char *string2, Char separator)
 Derive the types from the values in the first data line.
static Bool makeBool (const String &str)
 Turn the string into a Bool value.
static void handleKeyset (Int lineSize, char *string1, char *first, char *second, TableRecord &keysets, LogIO &logger, const String &fileName, ifstream &jFile, Int &lineNumber, Char separator, Bool testComment, const Regex &commentMarker, Int firstLine, Int lastLine)
 Handle a keyword set.
static Int getTypeShape (const String &typestr, IPosition &shape, Int &type)
 Get the shape and type from the type string.
static Bool getValue (char *string1, Int lineSize, char *first, Int &at1, Char separator, Int type, void *value)
 Get the next scalar value with the given type from string1.
static void handleScalar (char *string1, Int lineSize, char *first, Int &at1, Char separator, Int type, TableColumn &tabcol, rownr_t rownr)
 Handle the next scalar with the given type from the data line and put it into the table column.
static IPosition getArray (char *string1, Int lineSize, char *first, Int &at1, Char separator, const IPosition &shape, Int varAxis, Int type, void *valueBlock)
 Get the next array with the given type from string1.
static void handleArray (char *string1, Int lineSize, char *first, Int &at1, Char separator, const IPosition &shape, Int varAxis, Int type, TableColumn &tabcol, rownr_t rownr)
 Get the next array with the given type from the data line and put it into the table column.

Detailed Description

Helper class for readAsciiTable.

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Intended use:

Internal

Synopsis

This class contains static functions as helpers for readAsciiTable.

Definition at line 317 of file ReadAsciiTable.h.

Member Enumeration Documentation

◆ RATType

Define types.

Enumerator
RATBool 
RATShort 
RATInt 
RATFloat 
RATDouble 
RATString 
RATComX 
RATComZ 
RATDComX 
RATDComZ 
RATDMS 
RATHMS 

Definition at line 347 of file ReadAsciiTable.h.

Member Function Documentation

◆ doRun()

String casacore::ReadAsciiTable::doRun ( const String & headerfile,
const String & filein,
const String & tableproto,
const String & tablename,
Bool autoHeader,
const IPosition & autoShape,
const Vector< String > & columnNames,
const Vector< String > & dataTypes,
Char separator,
Bool testComment,
const Regex & commentMarker,
Int firstLine,
Int lastLine )
staticprivate

Do the actual run.

◆ getArray()

IPosition casacore::ReadAsciiTable::getArray ( char * string1,
Int lineSize,
char * first,
Int & at1,
Char separator,
const IPosition & shape,
Int varAxis,
Int type,
void * valueBlock )
staticprivate

Get the next array with the given type from string1.

It returns the shape (for variable shaped arrays).

References first, and casacore::shape().

◆ getLine()

Bool casacore::ReadAsciiTable::getLine ( ifstream & file,
Int & lineNumber,
char * line,
Int lineSize,
Bool testComment,
const Regex & commentMarker,
Int firstLine,
Int lastLine )
staticprivate

Get the next line.

Skip lines to be ignored. It returns False when no more lines are available.

◆ getNext()

Int casacore::ReadAsciiTable::getNext ( const Char * string,
Int strlen,
Char * result,
Int & at,
Char separator )
staticprivate

Get the next part of the line using the separator as delimiter.

Leading blanks are ignored.

◆ getTypes()

void casacore::ReadAsciiTable::getTypes ( const IPosition & shape,
const Char * in,
Int leng,
Char * string1,
Char * string2,
Char separator )
staticprivate

Derive the types from the values in the first data line.

References casacore::shape().

◆ getTypeShape()

Int casacore::ReadAsciiTable::getTypeShape ( const String & typestr,
IPosition & shape,
Int & type )
staticprivate

Get the shape and type from the type string.

References casacore::shape().

◆ getValue()

Bool casacore::ReadAsciiTable::getValue ( char * string1,
Int lineSize,
char * first,
Int & at1,
Char separator,
Int type,
void * value )
staticprivate

Get the next scalar value with the given type from string1.

References first, and casacore::NewDelAllocator< T >::value.

◆ handleArray()

void casacore::ReadAsciiTable::handleArray ( char * string1,
Int lineSize,
char * first,
Int & at1,
Char separator,
const IPosition & shape,
Int varAxis,
Int type,
TableColumn & tabcol,
rownr_t rownr )
staticprivate

Get the next array with the given type from the data line and put it into the table column.

References first, and casacore::shape().

◆ handleKeyset()

void casacore::ReadAsciiTable::handleKeyset ( Int lineSize,
char * string1,
char * first,
char * second,
TableRecord & keysets,
LogIO & logger,
const String & fileName,
ifstream & jFile,
Int & lineNumber,
Char separator,
Bool testComment,
const Regex & commentMarker,
Int firstLine,
Int lastLine )
staticprivate

Handle a keyword set.

References first.

◆ handleScalar()

void casacore::ReadAsciiTable::handleScalar ( char * string1,
Int lineSize,
char * first,
Int & at1,
Char separator,
Int type,
TableColumn & tabcol,
rownr_t rownr )
staticprivate

Handle the next scalar with the given type from the data line and put it into the table column.

References first.

◆ makeBool()

Bool casacore::ReadAsciiTable::makeBool ( const String & str)
staticprivate

Turn the string into a Bool value.

Empty string, value 0 and any value starting with f, F, n or N are False.

◆ makeTab()

Table casacore::ReadAsciiTable::makeTab ( String & formatString,
Table::TableType tableType,
const String & headerfile,
const String & filein,
const String & tableproto,
const String & tablename,
Bool autoHeader,
const IPosition & autoShape,
const Vector< String > & columnNames,
const Vector< String > & dataTypes,
Char separator,
Bool testComment,
const Regex & commentMarker,
Int firstLine,
Int lastLine )
staticprivate

Do the actual work of making and filling the table.

◆ run()

String casacore::ReadAsciiTable::run ( const String & headerfile,
const String & filein,
const String & tableproto,
const String & tablename,
Bool autoHeader,
const IPosition & autoShape,
const Vector< String > & columnNames,
const Vector< String > & dataTypes,
Char separator,
const String & commentMarkerRegex,
Int firstLine,
Int lastLine )
static

Run the readAsciiTable.

◆ runt()

Table casacore::ReadAsciiTable::runt ( String & formatString,
Table::TableType tableType,
const String & headerfile,
const String & filein,
const String & tableproto,
const String & tablename,
Bool autoHeader,
const IPosition & autoShape,
const Vector< String > & columnNames,
const Vector< String > & dataTypes,
Char separator,
const String & commentMarkerRegex,
Int firstLine,
Int lastLine )
static

◆ stringToPos()

double casacore::ReadAsciiTable::stringToPos ( const String & pos,
Bool isDMS )
static

Read a position using MVAngle.

If isDMS is True, a position with : is treated as DMS instead of HMS. This function is a bit more relaxed than MVAngle::read. It allows whitespace. Furthermore it allows whitespace as separator :.


The documentation for this class was generated from the following file: