diff options
Diffstat (limited to 'lib/notion.cpp')
| -rw-r--r-- | lib/notion.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
| diff --git a/lib/notion.cpp b/lib/notion.cpp index c227b46..733c852 100644 --- a/lib/notion.cpp +++ b/lib/notion.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "notion.h" | 1 | #include "notion.h" |
| 2 | #include <sqlite3.h> | ||
| 3 | #include <sstream> | 2 | #include <sstream> |
| 3 | #include <hkutil/database.h> | ||
| 4 | 4 | ||
| 5 | namespace verbly { | 5 | namespace verbly { |
| 6 | 6 | ||
| @@ -58,21 +58,21 @@ namespace verbly { | |||
| 58 | const field notion::preposition_group_field::isA = field::joinField(object::notion, "notion_id", "is_a"); | 58 | const field notion::preposition_group_field::isA = field::joinField(object::notion, "notion_id", "is_a"); |
| 59 | const field notion::preposition_group_field::groupNameField = field::stringField("is_a", "groupname"); | 59 | const field notion::preposition_group_field::groupNameField = field::stringField("is_a", "groupname"); |
| 60 | 60 | ||
| 61 | notion::notion(const database& db, sqlite3_stmt* row) : db_(&db), valid_(true) | 61 | notion::notion(const database& db, hatkirby::row row) : valid_(true) |
| 62 | { | 62 | { |
| 63 | id_ = sqlite3_column_int(row, 0); | 63 | id_ = mpark::get<int>(row[0]); |
| 64 | partOfSpeech_ = static_cast<part_of_speech>(sqlite3_column_int(row, 1)); | 64 | partOfSpeech_ = static_cast<part_of_speech>(mpark::get<int>(row[1])); |
| 65 | 65 | ||
| 66 | if (sqlite3_column_type(row, 2) != SQLITE_NULL) | 66 | if (!mpark::holds_alternative<std::nullptr_t>(row[2])) |
| 67 | { | 67 | { |
| 68 | hasWnid_ = true; | 68 | hasWnid_ = true; |
| 69 | wnid_ = sqlite3_column_int(row, 2); | 69 | wnid_ = mpark::get<int>(row[2]); |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | if (sqlite3_column_type(row, 3) != SQLITE_NULL) | 72 | if (!mpark::holds_alternative<std::nullptr_t>(row[3])) |
| 73 | { | 73 | { |
| 74 | hasNumOfImages_ = true; | 74 | hasNumOfImages_ = true; |
| 75 | numOfImages_ = sqlite3_column_int(row, 3); | 75 | numOfImages_ = mpark::get<int>(row[3]); |
| 76 | } | 76 | } |
| 77 | } | 77 | } |
| 78 | 78 | ||
