Loading...
Searching...
No Matches
casacore::TableParseUtil Namespace Reference
tables package (libcasa_tables) » TaQL_module » TaQL_module_internal_classes

More...

## Functions

Table | getTable (Int tabnr, const String &name, const Table &ftab, const std::vector< const Table * > &tempTables, const std::vector< TableParseQuery * > &stack, Bool alwaysOpen=True)
| Make a Table object for given name, seqnr or so.
Table | openParentTable (const String &fullName, const String &subTableName, const std::vector< const Table * > &tempTables, const std::vector< TableParseQuery * > &stack)
| Open the parent table of a subtable.
Bool | splitName (String &shorthand, String &columnName, Vector< String > &fieldNames, const String &name, Bool checkError, Bool isKeyword, Bool allowNoKey)
| Split a name into its parts (shorthand, column and field names).
void | setRecFld (RecordInterface &rec, const String &name, const String &dtype, const ValueHolder &vh)
| Define a field with the given data type in the Record.
String | getTypeString (const String &typeStr, DataType type)
| Get the type string.
Block< String > | getStoredColumns (const Table &tab)
| Find the names of all stored columns in a table.
TableExprNode | getColSet (const Table &table)
| Make an array from the contents of a column in a subquery.

## Detailed Description

Convenience functions for TableParse classes

### Intended use:

Internal

### Review Status

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

### Synopsis

This file contains several static helper functions for TableParse. They handle splitting a name into its shorthand, column and/or keyword parts. A name can be given as shorthand.column::key.subkey1.subkey2... where each part is optional. It also has functions to find the given table, column and keyword.

## Function Documentation

## getColSet()

TableExprNode casacore::TableParseUtil::getColSet | ( | const Table & | table | ) |

Make an array from the contents of a column in a subquery.

## getStoredColumns()

Block< String > casacore::TableParseUtil::getStoredColumns | ( | const Table & | tab | ) |

Find the names of all stored columns in a table.

## getTable()

Table casacore::TableParseUtil::getTable | ( | Int | tabnr,
|  | const String & | name,
|  | const Table & | ftab,
|  | const std::vector< const Table * > & | tempTables,
|  | const std::vector< TableParseQuery * > & | stack,
|  | Bool | alwaysOpen = True )

Make a Table object for given name, seqnr or so.

If alwaysOpen=False the table will only be looked up, but not opened if not found. This is meant for concatenated tables in TaQLNodeHandler.

References casacore::name(), and casacore::True.

## getTypeString()

String casacore::TableParseUtil::getTypeString | ( | const String & | typeStr,
|  | DataType | type )

Get the type string.

If empty, it is made from the given data type.

## openParentTable()

Table casacore::TableParseUtil::openParentTable | ( | const String & | fullName,
|  | const String & | subTableName,
|  | const std::vector< const Table * > & | tempTables,
|  | const std::vector< TableParseQuery * > & | stack )

Open the parent table of a subtable.

## setRecFld()

void casacore::TableParseUtil::setRecFld | ( | RecordInterface & | rec,
|  | const String & | name,
|  | const String & | dtype,
|  | const ValueHolder & | vh )

Define a field with the given data type in the Record.

References casacore::name(), and casacore::RecordInterface().

## splitName()

Bool casacore::TableParseUtil::splitName | ( | String & | shorthand,
|  | String & | columnName,
|  | Vector< String > & | fieldNames,
|  | const String & | name,
|  | Bool | checkError,
|  | Bool | isKeyword,
|  | Bool | allowNoKey )

Split a name into its parts (shorthand, column and field names).

A name can be given as [shorthand][column][::key1.key2.key3...] where the square brackets indicate optional parts. Note that a single name given before :: is interpreted as a shorthand unless preceded by a period.
True is returned if the name contains a keyword part. In that case fieldNames contains the keyword name and the possible subfields. The possible shorthand and the column name are filled in if it is a column keyword. If the name contains a column, fieldNames is filled with the subfields of the column (for the case where the column contains records).
If isKeyword is True, the first part of name is a keyword, even if no :: is given. If allowNoKey is True, a single :: is allowed, otherwise the name is invalid. If the name is invalid, exceptions are only thrown if checkError=True. Otherwise the name is treated as a normal name without keyword.

References casacore::name().