android: Update app icon to new startcenter icon
[LibreOffice.git] / dbaccess / source / filter / hsqldb / parseschema.hxx
blob04a8e09050a3406cf36852689f84c81a702627d8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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 */
10 #pragma once
12 #include <com/sun/star/embed/XStorage.hpp>
13 #include <vector>
14 #include <map>
16 #include "columndef.hxx"
18 namespace dbahsql
20 using SqlStatementVector = std::vector<OUString>;
22 class SchemaParser
24 private:
25 css::uno::Reference<css::embed::XStorage>& m_rStorage;
27 // column type for each table. It is filled after parsing schema.
28 std::map<OUString, std::vector<ColumnDefinition>> m_ColumnTypes;
30 // root element's position of data for each table
31 std::map<OUString, std::vector<sal_Int32>> m_Indexes;
33 // primary keys of each table
34 std::map<OUString, std::vector<OUString>> m_PrimaryKeys;
36 SqlStatementVector m_sCreateStatements;
37 SqlStatementVector m_sAlterStatements;
39 public:
40 explicit SchemaParser(css::uno::Reference<css::embed::XStorage>& rStorage);
42 /**
43 * Parses table definitions contained by a file called "script" in storage.
45 void parseSchema();
47 /**
48 * @return A vector of schema definition SQL strings in Firebird dialect.
50 const SqlStatementVector& getCreateStatements() const { return m_sCreateStatements; }
52 /**
53 * @return A vector of alter SQL strings in Firebird dialect.
55 const SqlStatementVector& getAlterStatements() const { return m_sAlterStatements; }
57 /**
58 * Returns the column types of a table. It should not be called before
59 * calling parseSchema().
61 * @param sTableName name of the table.
63 * @return A vector of column descriptors.
65 std::vector<ColumnDefinition> getTableColumnTypes(const OUString& sTableName) const;
67 /**
68 * Returns a vector of indexes for each table. These indexes are used for
69 * locating the data related to the actual table in the binary file.
71 * The indexes point to root elements of AVL trees. Each node of the tree
72 * contains one row.
74 const std::map<OUString, std::vector<sal_Int32>>& getTableIndexes() const;
76 /**
77 * Returns a vector of column names for each table. These columns are the
78 * primary keys of the table.
80 const std::map<OUString, std::vector<OUString>>& getPrimaryKeys() const;
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */