casacore
|
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. More... | |
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. More... | |
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. More... | |
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. More... | |
static Bool | getLine (ifstream &file, Int &lineNumber, char *line, Int lineSize, Bool testComment, const Regex &commentMarker, Int firstLine, Int lastLine) |
Get the next line. More... | |
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. More... | |
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. More... | |
static Bool | makeBool (const String &str) |
Turn the string into a Bool value. More... | |
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. More... | |
static Int | getTypeShape (const String &typestr, IPosition &shape, Int &type) |
Get the shape and type from the type string. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
Helper class for readAsciiTable.
Internal
This class contains static functions as helpers for readAsciiTable.
Definition at line 319 of file ReadAsciiTable.h.
|
private |
Define types.
Enumerator | |
---|---|
RATBool | |
RATShort | |
RATInt | |
RATFloat | |
RATDouble | |
RATString | |
RATComX | |
RATComZ | |
RATDComX | |
RATDComZ | |
RATDMS | |
RATHMS |
Definition at line 349 of file ReadAsciiTable.h.
|
staticprivate |
Do the actual run.
|
staticprivate |
Get the next array with the given type from string1.
It returns the shape (for variable shaped arrays).
|
staticprivate |
Get the next line.
Skip lines to be ignored. It returns False when no more lines are available.
|
staticprivate |
Get the next part of the line using the separator as delimiter.
Leading blanks are ignored.
|
staticprivate |
Derive the types from the values in the first data line.
|
staticprivate |
Get the shape and type from the type string.
|
staticprivate |
Get the next scalar value with the given type from string1.
|
staticprivate |
Get the next array with the given type from the data line and put it into the table column.
|
staticprivate |
Handle a keyword set.
|
staticprivate |
Handle the next scalar with the given type from the data line and put it into the table column.
Turn the string into a Bool value.
Empty string, value 0 and any value starting with f, F, n or N are False.
|
staticprivate |
Do the actual work of making and filling the table.
|
static |
Run the readAsciiTable.
|
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 :.