diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-03-16 21:35:35 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-03-16 21:35:35 -0400 |
commit | 8b1333d0e6e2b9a5014bdbff2987d899f5413fee (patch) | |
tree | ab5c864b61cab267ad3118e8cbe637c151448aa5 /verbly/lib/data.cpp | |
parent | 3aceae8ab1eb5992110ea57a9479bbc3177feb21 (diff) | |
download | furries-8b1333d0e6e2b9a5014bdbff2987d899f5413fee.tar.gz furries-8b1333d0e6e2b9a5014bdbff2987d899f5413fee.tar.bz2 furries-8b1333d0e6e2b9a5014bdbff2987d899f5413fee.zip |
Added word derivational relationships (kind of eh at the moment) and moved verbly into its own directory
Diffstat (limited to 'verbly/lib/data.cpp')
-rw-r--r-- | verbly/lib/data.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/verbly/lib/data.cpp b/verbly/lib/data.cpp new file mode 100644 index 0000000..57a8850 --- /dev/null +++ b/verbly/lib/data.cpp | |||
@@ -0,0 +1,50 @@ | |||
1 | #include "verbly.h" | ||
2 | |||
3 | namespace verbly { | ||
4 | |||
5 | data::data(std::string datafile) | ||
6 | { | ||
7 | if (sqlite3_open_v2(datafile.c_str(), &ppdb, SQLITE_OPEN_READONLY, NULL) != SQLITE_OK) | ||
8 | { | ||
9 | throw std::invalid_argument(sqlite3_errmsg(ppdb)); | ||
10 | } | ||
11 | } | ||
12 | |||
13 | data::data(data&& other) | ||
14 | { | ||
15 | ppdb = other.ppdb; | ||
16 | } | ||
17 | |||
18 | data& data::operator=(data&& other) | ||
19 | { | ||
20 | ppdb = other.ppdb; | ||
21 | |||
22 | return *this; | ||
23 | } | ||
24 | |||
25 | data::~data() | ||
26 | { | ||
27 | sqlite3_close_v2(ppdb); | ||
28 | } | ||
29 | |||
30 | verb_query data::verbs() const | ||
31 | { | ||
32 | return verb_query(*this); | ||
33 | } | ||
34 | |||
35 | adjective_query data::adjectives() const | ||
36 | { | ||
37 | return adjective_query(*this); | ||
38 | } | ||
39 | |||
40 | adverb_query data::adverbs() const | ||
41 | { | ||
42 | return adverb_query(*this); | ||
43 | } | ||
44 | |||
45 | noun_query data::nouns() const | ||
46 | { | ||
47 | return noun_query(*this); | ||
48 | } | ||
49 | |||
50 | }; | ||