From 38c17f093615a16a4b4ec6dc2b5d3edb5c1d3895 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 27 Sep 2018 21:40:52 -0400 Subject: More hkutil refactoring All database access goes through hatkirby::database now. verbly::token, verbly::statement::condition, and verbly::part have been converted to use mpark::variant now. verbly::binding has been deleted, and replaced with a mpark::variant typedef in statement.h. This means that the only remaining tagged union class is verbly::generator::part. refs #5 --- lib/pronunciation.h | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'lib/pronunciation.h') diff --git a/lib/pronunciation.h b/lib/pronunciation.h index 73329e4..cd241bd 100644 --- a/lib/pronunciation.h +++ b/lib/pronunciation.h @@ -4,11 +4,10 @@ #include #include #include +#include #include "field.h" #include "filter.h" -struct sqlite3_stmt; - namespace verbly { class form; @@ -24,7 +23,7 @@ namespace verbly { // Construct from database - pronunciation(const database& db, sqlite3_stmt* row); + pronunciation(const database& db, hatkirby::row row); // Accessors @@ -63,7 +62,7 @@ namespace verbly { return syllables_; } - std::string getStress() const + const std::string& getStress() const { if (!valid_) { @@ -83,7 +82,7 @@ namespace verbly { return hasRhyme_; } - std::string getPrerhyme() const + const std::string& getPrerhyme() const { if (!valid_) { @@ -98,7 +97,7 @@ namespace verbly { return prerhyme_; } - std::string getRhyme() const + const std::string& getRhyme() const { if (!valid_) { @@ -167,8 +166,11 @@ namespace verbly { static const rhymes_field rhymes; private: - bool valid_ = false; + static const field prerhyme; + static const field rhyme; + + bool valid_ = false; int id_; std::vector phonemes_; int syllables_; @@ -176,12 +178,6 @@ namespace verbly { bool hasRhyme_ = false; std::string prerhyme_; std::string rhyme_; - - const database* db_; - - static const field prerhyme; - static const field rhyme; - }; }; -- cgit 1.4.1