summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2018-04-07 16:05:26 +0200
committerTamás Bunth <btomi96@gmail.com>2018-04-07 18:31:37 +0200
commitb29f801e4106b0c729e90ff7c1b1718b671fd32d (patch)
tree2938552713e50934b5df2ef25861bc1cea68910c
parent29c6629a54bd5d6cb8ccbfc663b1fed36c57e616 (diff)
dbahsql: Add doxygen comments
Change-Id: Ie666d4d8660d29c36479c2e8a1289bd789d1433b Reviewed-on: https://gerrit.libreoffice.org/52549 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
-rw-r--r--dbaccess/source/filter/hsqldb/createparser.hxx23
-rw-r--r--dbaccess/source/filter/hsqldb/fbcreateparser.hxx8
-rw-r--r--dbaccess/source/filter/hsqldb/hsqlbinarynode.hxx28
-rw-r--r--dbaccess/source/filter/hsqldb/hsqlimport.hxx11
-rw-r--r--dbaccess/source/filter/hsqldb/parseschema.hxx20
-rw-r--r--dbaccess/source/filter/hsqldb/rowinputbinary.hxx11
6 files changed, 99 insertions, 2 deletions
diff --git a/dbaccess/source/filter/hsqldb/createparser.hxx b/dbaccess/source/filter/hsqldb/createparser.hxx
index 5aa6bc0e9b16..d23eef83b91b 100644
--- a/dbaccess/source/filter/hsqldb/createparser.hxx
+++ b/dbaccess/source/filter/hsqldb/createparser.hxx
@@ -28,10 +28,33 @@ protected:
public:
CreateStmtParser();
virtual ~CreateStmtParser() {}
+
+ /**
+ * @return name of the table which is to be created.
+ */
OUString getTableName() const { return m_sTableName; }
+
+ /**
+ * @return a vector of column descriptors, representing the columns of the
+ * parsed statement.
+ */
const std::vector<ColumnDefinition>& getColumnDef() const { return m_aColumns; }
+
+ /**
+ * @return a vector of words.
+ */
const std::vector<OUString>& getForeignParts() const { return m_aForeignParts; }
+
+ /**
+ * Parses a create statement.
+ *
+ * @param SQL "CREATE" statement
+ */
void parse(const OUString& sSql);
+
+ /**
+ * Recreate the sql statement.
+ */
virtual OUString compose() const = 0;
};
}
diff --git a/dbaccess/source/filter/hsqldb/fbcreateparser.hxx b/dbaccess/source/filter/hsqldb/fbcreateparser.hxx
index 98b90158051a..fab6752b8b0d 100644
--- a/dbaccess/source/filter/hsqldb/fbcreateparser.hxx
+++ b/dbaccess/source/filter/hsqldb/fbcreateparser.hxx
@@ -17,7 +17,15 @@ namespace dbahsql
class SAL_DLLPUBLIC_EXPORT FbCreateStmtParser : public CreateStmtParser
{
public:
+ /**
+ * Create statement parser, which can compose the result to statements of
+ * Firebird dialect.
+ */
FbCreateStmtParser() {}
+
+ /**
+ * Compose the result of the parser to statements of Firebird dialect
+ */
virtual OUString compose() const override;
};
diff --git a/dbaccess/source/filter/hsqldb/hsqlbinarynode.hxx b/dbaccess/source/filter/hsqldb/hsqlbinarynode.hxx
index 71e0fd799171..5abc294bec2f 100644
--- a/dbaccess/source/filter/hsqldb/hsqlbinarynode.hxx
+++ b/dbaccess/source/filter/hsqldb/hsqlbinarynode.hxx
@@ -26,10 +26,36 @@ private:
sal_Int32 m_nPos = -1;
public:
+ /**
+ * Represents one element of an AVL tree in the binary file which contains
+ * the data.
+ */
HsqlBinaryNode(sal_Int32 nPos);
- void readChildren(HsqlRowInputStream& input);
+
+ /**
+ * Read position of children from data file.
+ *
+ * @param rInput input stream where the positions should be read from.
+ */
+ void readChildren(HsqlRowInputStream& rInput);
+
+ /**
+ * Get Position of left children. It should be called only after position of
+ * children is read.
+ */
sal_Int32 getLeft() const;
+
+ /**
+ * Get Position of right children. It should be called only after position of
+ * children is read.
+ */
sal_Int32 getRight() const;
+
+ /**
+ * Read the row represented by this node.
+ *
+ * @param rInput input stream where the row should be read from.
+ */
std::vector<css::uno::Any> readRow(HsqlRowInputStream& rInput,
const std::vector<ColumnDefinition>& aColTypes);
};
diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.hxx b/dbaccess/source/filter/hsqldb/hsqlimport.hxx
index d6975ce80c8b..1df9ddbc3a10 100644
--- a/dbaccess/source/filter/hsqldb/hsqlimport.hxx
+++ b/dbaccess/source/filter/hsqldb/hsqlimport.hxx
@@ -34,9 +34,20 @@ protected:
const std::vector<ColumnDefinition>& rColTypes, const OUString& sTableName);
public:
+ /**
+ * @param rConnection reference to an sdbc connection. The migration will
+ * perform to this connection.
+ *
+ * @param rStorage Storage where the HSQL database can be found. The schema
+ * definition should be in file "script" in form of DDL SQL statements. The
+ * data should be found in file "data". These are HSQLDB's own format.
+ */
HsqlImporter(css::uno::Reference<css::sdbc::XConnection>& rConnection,
const css::uno::Reference<css::embed::XStorage>& rStorage);
+ /**
+ * Migrate a HSQL database to another.
+ */
void importHsqlDatabase();
};
}
diff --git a/dbaccess/source/filter/hsqldb/parseschema.hxx b/dbaccess/source/filter/hsqldb/parseschema.hxx
index b22f5e12fe90..6f73d2a4e584 100644
--- a/dbaccess/source/filter/hsqldb/parseschema.hxx
+++ b/dbaccess/source/filter/hsqldb/parseschema.hxx
@@ -35,10 +35,30 @@ private:
public:
explicit SchemaParser(css::uno::Reference<css::embed::XStorage>& rStorage);
+ /**
+ * Parses table definitions contained by a file called "script" in storage.
+ *
+ * @return A vector of schema definition SQL strings in Firebird dialect.
+ */
SqlStatementVector parseSchema();
+ /**
+ * Returns the colmn types of a table. It should not be called before
+ * calling parseSchema().
+ *
+ * @param sTableName name of the table.
+ *
+ * @return A vector of column descriptors.
+ */
std::vector<ColumnDefinition> getTableColumnTypes(const OUString& sTableName) const;
+ /**
+ * Returns a vector of indexes for each table. These indexes are used for
+ * locating the data related to the actual table in the binary file.
+ *
+ * The indexes point to root elements of AVL trees. Each node of the tree
+ * contains one row.
+ */
const std::map<OUString, std::vector<sal_Int32>>& getTableIndexes() const;
};
}
diff --git a/dbaccess/source/filter/hsqldb/rowinputbinary.hxx b/dbaccess/source/filter/hsqldb/rowinputbinary.hxx
index 8fcdf1ec0cd5..1fa5a6066476 100644
--- a/dbaccess/source/filter/hsqldb/rowinputbinary.hxx
+++ b/dbaccess/source/filter/hsqldb/rowinputbinary.hxx
@@ -29,13 +29,22 @@ protected:
OUString readString();
bool checkNull();
- // reimplement reading of an UTF string with a given length
OUString readUTF(sal_Int32 nLen);
public:
HsqlRowInputStream();
+
+ /**
+ * Reads one row from the actual position.
+ * @param colTypes Field types of the row, in a strict order.
+ */
std::vector<css::uno::Any> readOneRow(const std::vector<ColumnDefinition>& colTypes);
+
+ /**
+ * Sets the file-pointer offset, measured from the beginning of the file
+ */
void seek(sal_Int32 nPos);
+
void setInputStream(css::uno::Reference<css::io::XInputStream>& rStream);
SvStream* getInputStream() const;
};