LibreOffice Module dbaccess (master) 1
createparser.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#pragma once
11
12#include <vector>
13#include "columndef.hxx"
14
15namespace dbahsql
16{
17class SAL_DLLPUBLIC_EXPORT CreateStmtParser
18{
19private:
20 std::vector<ColumnDefinition> m_aColumns;
21 std::vector<OUString> m_aForeignParts;
22 std::vector<OUString> m_PrimaryKeys;
23 OUString m_sTableName;
24
25protected:
26 void parseColumnPart(std::u16string_view sColumnPart);
27 void parsePrimaryKeys(std::u16string_view sPrimaryPart);
28
29public:
31 virtual ~CreateStmtParser() {}
32
36 OUString const& getTableName() const { return m_sTableName; }
37
41 std::vector<OUString> const& getPrimaryKeys() const { return m_PrimaryKeys; }
42
47 const std::vector<ColumnDefinition>& getColumnDef() const { return m_aColumns; }
48
52 const std::vector<OUString>& getForeignParts() const { return m_aForeignParts; }
53
59 void parse(std::u16string_view sSql);
60
64 virtual OUString compose() const = 0;
65};
66}
67
68/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString m_sTableName
std::vector< OUString > m_PrimaryKeys
const std::vector< OUString > & getForeignParts() const
virtual OUString compose() const =0
Recreate the sql statement.
std::vector< OUString > const & getPrimaryKeys() const
OUString const & getTableName() const
std::vector< ColumnDefinition > m_aColumns
std::vector< OUString > m_aForeignParts
const std::vector< ColumnDefinition > & getColumnDef() const
bool parse(OUString const &uri, SourceProviderScannerData *data)