susumu.yata
null+****@clear*****
Tue Jul 15 10:56:56 JST 2014
susumu.yata 2014-07-15 10:56:56 +0900 (Tue, 15 Jul 2014) New Revision: e0ec35efc6a1967984adb4146b20e62d9627f8ed https://github.com/groonga/grnxx/commit/e0ec35efc6a1967984adb4146b20e62d9627f8ed Message: Use the default options if unspecified. Modified files: include/grnxx/column.hpp include/grnxx/db.hpp include/grnxx/index.hpp include/grnxx/table.hpp Modified: include/grnxx/column.hpp (+13 -11) =================================================================== --- include/grnxx/column.hpp 2014-07-15 10:41:07 +0900 (f492b4a) +++ include/grnxx/column.hpp 2014-07-15 10:56:56 +0900 (ab54e3c) @@ -44,10 +44,11 @@ class Column { // Returns a pointer to the index on success. // On failure, returns nullptr and stores error information into "*error" if // "error" != nullptr. - virtual Index *create_index(Error *error, - String name, - IndexType index_type, - const IndexOptions &index_options); + virtual Index *create_index( + Error *error, + String name, + IndexType index_type, + const IndexOptions &index_options = IndexOptions()); // Remove an index named "name". // @@ -124,7 +125,7 @@ class Column { // "error" != nullptr. virtual unique_ptr<Cursor> create_cursor( Error *error, - const CursorOptions &options) const; + const CursorOptions &options = CursorOptions()) const; protected: Table *table_; @@ -144,7 +145,7 @@ class Column { Table *table, String name, DataType data_type, - const ColumnOptions &options); + const ColumnOptions &options = ColumnOptions()); private: // Create a new column. @@ -152,11 +153,12 @@ class Column { // Returns a pointer to the column on success. // On failure, returns nullptr and stores error information into "*error" if // "error" != nullptr. - static unique_ptr<Column> create(Error *error, - Table *table, - String name, - DataType data_type, - const ColumnOptions &options); + static unique_ptr<Column> create( + Error *error, + Table *table, + String name, + DataType data_type, + const ColumnOptions &options = ColumnOptions()); // Change the column name. // Modified: include/grnxx/db.hpp (+6 -4) =================================================================== --- include/grnxx/db.hpp 2014-07-15 10:41:07 +0900 (13508fe) +++ include/grnxx/db.hpp 2014-07-15 10:56:56 +0900 (e73a434) @@ -23,7 +23,7 @@ class DB { // "error" != nullptr. Table *create_table(Error *error, String name, - const TableOptions &options); + const TableOptions &options = TableOptions()); // Remove a table named "name". // @@ -84,7 +84,7 @@ class DB { // "error" != nullptr. bool save(Error *error, String path, - const DBOptions &options) const; + const DBOptions &options = DBOptions()) const; private: std::vector<unique_ptr<Table>> tables_; @@ -114,14 +114,16 @@ class DB { // "error" != nullptr. unique_ptr<DB> open_db(Error *error, String path, - const DBOptions &options); + const DBOptions &options = DBOptions()); // Remove a database identified by "path". // // Returns true on success. // On failure, returns false and stores error information into "*error" if // "error" != nullptr. -bool remove_db(Error *error, String path, const DBOptions &options); +bool remove_db(Error *error, + String path, + const DBOptions &options = DBOptions()); } // namespace grnxx Modified: include/grnxx/index.hpp (+7 -6) =================================================================== --- include/grnxx/index.hpp 2014-07-15 10:41:07 +0900 (4659756) +++ include/grnxx/index.hpp 2014-07-15 10:56:56 +0900 (7ed194f) @@ -30,7 +30,7 @@ class Index { // "error" != nullptr. virtual unique_ptr<Cursor> create_cursor( Error *error, - const CursorOptions &options) const; + const CursorOptions &options = CursorOptions()) const; private: Column *column_; @@ -42,11 +42,12 @@ class Index { // Returns a pointer to the index on success. // On failure, returns nullptr and stores error information into "*error" if // "error" != nullptr. - static unique_ptr<Index> create(Error *error, - Column *column, - String name, - IndexType type, - const IndexOptions &options); + static unique_ptr<Index> create( + Error *error, + Column *column, + String name, + IndexType type, + const IndexOptions &options = IndexOptions()); Index(); Modified: include/grnxx/table.hpp (+8 -7) =================================================================== --- include/grnxx/table.hpp 2014-07-15 10:41:07 +0900 (5878bba) +++ include/grnxx/table.hpp 2014-07-15 10:56:56 +0900 (b86f598) @@ -41,7 +41,7 @@ class Table { Column *create_column(Error *error, String name, DataType data_type, - const ColumnOptions &options); + const ColumnOptions &options = ColumnOptions()); // Remove a column named "name". // @@ -163,7 +163,7 @@ class Table { // "error" != nullptr. unique_ptr<Cursor> create_cursor( Error *error, - const CursorOptions &options) const; + const CursorOptions &options = CursorOptions()) const; // Create an object to build ordering information. // @@ -193,7 +193,7 @@ class Table { // unique_ptr<Grouper> create_grouper( // Error *error, // unique_ptr<Expression> &&expression, -// const GrouperOptions &options) const; +// const GrouperOptions &options = GrouperOptions()) const; private: DB *db_; @@ -208,10 +208,11 @@ class Table { // Returns a pointer to the table on success. // On failure, returns nullptr and stores error information into "*error" if // "error" != nullptr. - static unique_ptr<Table> create(Error *error, - DB *db, - String name, - const TableOptions &options); + static unique_ptr<Table> create( + Error *error, + DB *db, + String name, + const TableOptions &options = TableOptions()); Table(); -------------- next part -------------- HTML����������������������������...Download