From b29f801e4106b0c729e90ff7c1b1718b671fd32d Mon Sep 17 00:00:00 2001 From: Tamas Bunth Date: Sat, 7 Apr 2018 16:05:26 +0200 Subject: dbahsql: Add doxygen comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie666d4d8660d29c36479c2e8a1289bd789d1433b Reviewed-on: https://gerrit.libreoffice.org/52549 Tested-by: Jenkins Reviewed-by: Tamás Bunth --- dbaccess/source/filter/hsqldb/createparser.hxx | 23 +++++++++++++++++++ dbaccess/source/filter/hsqldb/fbcreateparser.hxx | 8 +++++++ dbaccess/source/filter/hsqldb/hsqlbinarynode.hxx | 28 +++++++++++++++++++++++- dbaccess/source/filter/hsqldb/hsqlimport.hxx | 11 ++++++++++ dbaccess/source/filter/hsqldb/parseschema.hxx | 20 +++++++++++++++++ dbaccess/source/filter/hsqldb/rowinputbinary.hxx | 11 +++++++++- 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& getColumnDef() const { return m_aColumns; } + + /** + * @return a vector of words. + */ const std::vector& 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 readRow(HsqlRowInputStream& rInput, const std::vector& 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& 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& rConnection, const css::uno::Reference& 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& 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 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>& 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 readOneRow(const std::vector& colTypes); + + /** + * Sets the file-pointer offset, measured from the beginning of the file + */ void seek(sal_Int32 nPos); + void setInputStream(css::uno::Reference& rStream); SvStream* getInputStream() const; }; -- cgit v1.2.3