LibreOffice Module dbaccess (master) 1
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
dbahsql::CreateStmtParser Class Referenceabstract

#include <createparser.hxx>

Inheritance diagram for dbahsql::CreateStmtParser:
[legend]

Public Member Functions

 CreateStmtParser ()
 
virtual ~CreateStmtParser ()
 
OUString const & getTableName () const
 
std::vector< OUString > const & getPrimaryKeys () const
 
const std::vector< ColumnDefinition > & getColumnDef () const
 
const std::vector< OUString > & getForeignParts () const
 
void parse (std::u16string_view sSql)
 Parses a create statement. More...
 
virtual OUString compose () const =0
 Recreate the sql statement. More...
 

Protected Member Functions

void parseColumnPart (std::u16string_view sColumnPart)
 
void parsePrimaryKeys (std::u16string_view sPrimaryPart)
 

Private Attributes

std::vector< ColumnDefinitionm_aColumns
 
std::vector< OUString > m_aForeignParts
 
std::vector< OUString > m_PrimaryKeys
 
OUString m_sTableName
 

Detailed Description

Definition at line 17 of file createparser.hxx.

Constructor & Destructor Documentation

◆ CreateStmtParser()

dbahsql::CreateStmtParser::CreateStmtParser ( )

Definition at line 206 of file createparser.cxx.

◆ ~CreateStmtParser()

virtual dbahsql::CreateStmtParser::~CreateStmtParser ( )
inlinevirtual

Definition at line 31 of file createparser.hxx.

Member Function Documentation

◆ compose()

virtual OUString dbahsql::CreateStmtParser::compose ( ) const
pure virtual

Recreate the sql statement.

Implemented in dbahsql::FbCreateStmtParser.

◆ getColumnDef()

const std::vector< ColumnDefinition > & dbahsql::CreateStmtParser::getColumnDef ( ) const
inline
Returns
a vector of column descriptors, representing the columns of the parsed statement.

Definition at line 47 of file createparser.hxx.

Referenced by dbahsql::FbCreateStmtParser::compose(), dbahsql::FbCreateStmtParser::ensureProperTableLengths(), and dbahsql::SchemaParser::parseSchema().

◆ getForeignParts()

const std::vector< OUString > & dbahsql::CreateStmtParser::getForeignParts ( ) const
inline
Returns
a vector of words.

Definition at line 52 of file createparser.hxx.

Referenced by dbahsql::SchemaParser::parseSchema().

◆ getPrimaryKeys()

std::vector< OUString > const & dbahsql::CreateStmtParser::getPrimaryKeys ( ) const
inline
Returns
primary keys of parsed table.

Definition at line 41 of file createparser.hxx.

Referenced by dbahsql::FbCreateStmtParser::appendPrimaryKeyPart().

◆ getTableName()

OUString const & dbahsql::CreateStmtParser::getTableName ( ) const
inline
Returns
name of the table which is to be created.

Definition at line 36 of file createparser.hxx.

References m_sTableName.

Referenced by dbahsql::FbCreateStmtParser::compose(), and dbahsql::SchemaParser::parseSchema().

◆ parse()

void dbahsql::CreateStmtParser::parse ( std::u16string_view  sSql)

Parses a create statement.

Parameters
SQL"CREATE" statement

Definition at line 282 of file createparser.cxx.

References dbahsql::utils::getTableNameFromStmt(), m_sTableName, parseColumnPart(), SAL_WARN, o3tl::starts_with(), and u.

Referenced by dbahsql::SchemaParser::parseSchema().

◆ parseColumnPart()

void dbahsql::CreateStmtParser::parseColumnPart ( std::u16string_view  sColumnPart)
protected

Definition at line 223 of file createparser.cxx.

References m_aColumns, m_aForeignParts, m_PrimaryKeys, parsePrimaryKeys(), and o3tl::trim().

Referenced by parse().

◆ parsePrimaryKeys()

void dbahsql::CreateStmtParser::parsePrimaryKeys ( std::u16string_view  sPrimaryPart)
protected

Definition at line 208 of file createparser.cxx.

References m_PrimaryKeys, and u.

Referenced by parseColumnPart().

Member Data Documentation

◆ m_aColumns

std::vector<ColumnDefinition> dbahsql::CreateStmtParser::m_aColumns
private

Definition at line 20 of file createparser.hxx.

Referenced by parseColumnPart().

◆ m_aForeignParts

std::vector<OUString> dbahsql::CreateStmtParser::m_aForeignParts
private

Definition at line 21 of file createparser.hxx.

Referenced by parseColumnPart().

◆ m_PrimaryKeys

std::vector<OUString> dbahsql::CreateStmtParser::m_PrimaryKeys
private

Definition at line 22 of file createparser.hxx.

Referenced by parseColumnPart(), and parsePrimaryKeys().

◆ m_sTableName

OUString dbahsql::CreateStmtParser::m_sTableName
private

Definition at line 23 of file createparser.hxx.

Referenced by parse().


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