diff options
author | Peng Wu <alexepico@gmail.com> | 2016-03-03 17:19:22 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2016-03-03 17:19:22 +0800 |
commit | ce72a2532ad39b0cfec46ca344c99f09bb151c55 (patch) | |
tree | 4d68fdf6b68cc27b29f5daf2dd0380ab3690d322 /src/storage/phrase_large_table3_kyotodb.cpp | |
parent | 7c1f8a98786856cf145734c966beecce2dfeeb37 (diff) | |
download | libpinyin-ce72a2532ad39b0cfec46ca344c99f09bb151c55.tar.gz libpinyin-ce72a2532ad39b0cfec46ca344c99f09bb151c55.tar.xz libpinyin-ce72a2532ad39b0cfec46ca344c99f09bb151c55.zip |
use attach_options function
Diffstat (limited to 'src/storage/phrase_large_table3_kyotodb.cpp')
-rw-r--r-- | src/storage/phrase_large_table3_kyotodb.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/storage/phrase_large_table3_kyotodb.cpp b/src/storage/phrase_large_table3_kyotodb.cpp index 6241c74..e78f08e 100644 --- a/src/storage/phrase_large_table3_kyotodb.cpp +++ b/src/storage/phrase_large_table3_kyotodb.cpp @@ -23,6 +23,7 @@ #include "phrase_large_table3.h" #include <kchashdb.h> #include <kcprotodb.h> +#include "kyotodb_utils.h" using namespace kyotocabinet; @@ -55,16 +56,7 @@ void PhraseLargeTable3::reset() { /* attach method */ bool PhraseLargeTable3::attach(const char * dbfile, guint32 flags) { reset(); - uint32_t mode = 0; - - if (flags & ATTACH_READONLY) - mode |= BasicDB::OREADER; - if (flags & ATTACH_READWRITE) { - assert( !( flags & ATTACH_READONLY ) ); - mode |= BasicDB::OREADER | BasicDB::OWRITER; - } - if (flags & ATTACH_CREATE) - mode |= BasicDB::OCREATE; + uint32_t mode = attach_options(flags); if (!dbfile) return false; |