myTinySQL v0.2.0-2-g5000098
A tiny SQL interpreter over fixed-width text files
Loading...
Searching...
No Matches
Classes | Functions | Variables
tinysql::anonymous_namespace{Catalog.cpp} Namespace Reference

Classes

struct  Field
 The position of one field in a SYSTEM_TABLE line. More...
 

Functions

std::string_view cut (std::string_view line, Field field)
 Cuts one field out of a SYSTEM_TABLE line.
 
std::size_t number (std::string_view line, Field field, std::size_t lineNumber)
 Reads one numeric field of a SYSTEM_TABLE line.
 

Variables

constexpr Field kTable {15, 34}
 Table name.
 
constexpr Field kName {35, 54}
 Column name.
 
constexpr Field kType {55, 59}
 Column type (N1 or S1).
 
constexpr Field kFrom {60, 64}
 First character of the column in a data row.
 
constexpr Field kTo {65, 69}
 Last character of the column.
 
constexpr Field kRecordLength {75, 79}
 Length of a full data row.
 

Function Documentation

◆ cut()

std::string_view tinysql::anonymous_namespace{Catalog.cpp}::cut ( std::string_view  line,
Field  field 
)

Cuts one field out of a SYSTEM_TABLE line.

Parameters
lineThe line.
fieldWhere the field is.
Returns
The field's text without surrounding spaces; empty if the line is too short.

Definition at line 34 of file Catalog.cpp.

◆ number()

std::size_t tinysql::anonymous_namespace{Catalog.cpp}::number ( std::string_view  line,
Field  field,
std::size_t  lineNumber 
)

Reads one numeric field of a SYSTEM_TABLE line.

Parameters
lineThe line.
fieldWhere the field is.
lineNumberThe line's number in the file, for the error message.
Returns
The number.
Exceptions
SqlErrorIf the field is not a non-negative integer.

Definition at line 48 of file Catalog.cpp.

Variable Documentation

◆ kFrom

constexpr Field tinysql::anonymous_namespace{Catalog.cpp}::kFrom {60, 64}
constexpr

First character of the column in a data row.

Definition at line 26 of file Catalog.cpp.

◆ kName

constexpr Field tinysql::anonymous_namespace{Catalog.cpp}::kName {35, 54}
constexpr

Column name.

Definition at line 24 of file Catalog.cpp.

◆ kRecordLength

constexpr Field tinysql::anonymous_namespace{Catalog.cpp}::kRecordLength {75, 79}
constexpr

Length of a full data row.

Definition at line 28 of file Catalog.cpp.

◆ kTable

constexpr Field tinysql::anonymous_namespace{Catalog.cpp}::kTable {15, 34}
constexpr

Table name.

Definition at line 23 of file Catalog.cpp.

◆ kTo

constexpr Field tinysql::anonymous_namespace{Catalog.cpp}::kTo {65, 69}
constexpr

Last character of the column.

Definition at line 27 of file Catalog.cpp.

◆ kType

constexpr Field tinysql::anonymous_namespace{Catalog.cpp}::kType {55, 59}
constexpr

Column type (N1 or S1).

Definition at line 25 of file Catalog.cpp.