diff options
| author | Peng Huang <shawn.p.huang@gmail.com> | 2010-04-05 07:15:26 +0800 |
|---|---|---|
| committer | Peng Huang <shawn.p.huang@gmail.com> | 2010-04-05 07:15:26 +0800 |
| commit | 9ea30d33b9b720dbcd6cf507dbdf0128cbc3ba84 (patch) | |
| tree | d4cf8a82e061ab6dfb5233ae1995b99c109b15f8 /src/Database.h | |
| parent | 1f2e8fd251ed8ee8315b0a4560e9e89cfe0b2d9e (diff) | |
| download | ibus-libpinyin-9ea30d33b9b720dbcd6cf507dbdf0128cbc3ba84.tar.gz ibus-libpinyin-9ea30d33b9b720dbcd6cf507dbdf0128cbc3ba84.tar.xz ibus-libpinyin-9ea30d33b9b720dbcd6cf507dbdf0128cbc3ba84.zip | |
Refactory Database class
Diffstat (limited to 'src/Database.h')
| -rw-r--r-- | src/Database.h | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/Database.h b/src/Database.h index 3b89537..b24192a 100644 --- a/src/Database.h +++ b/src/Database.h @@ -15,50 +15,6 @@ namespace PY { using namespace std; -class Conditions : public vector<string> { -public: - Conditions (void) : - vector<string> (32), - m_length (0) { - reset (); - } - ~Conditions (void) { - } - guint length (void) { return m_length; } - void reset (void) { - m_length = 1; - operator[](0) = ""; - } - void _double (void) { - for (gint i = m_length - 1; i >= 0; i--) { - (*this)[m_length + i] = (*this)[i]; - } - m_length = m_length + m_length; - } - void triple (void) { - for (gint i = m_length - 1; i >= 0; i--) { - operator[](m_length + i) = operator[]((m_length << 1) + i) = operator[](i); - } - m_length = m_length + m_length + m_length; - } - void appendVPrintf (gint begin, gint end, const gchar *fmt, va_list args) { - gchar str[64]; - g_vsnprintf (str, sizeof(str), fmt, args); - for (gint i = begin; i < end; i++) { - operator[](i) += str; - } - } - void appendPrintf (gint begin, gint end, const gchar *fmt, ...) { - va_list args; - va_start (args, fmt); - appendVPrintf (begin, end, fmt, args); - va_end (args); - } -private: - guint m_length; -}; - - class Database { public: Database (); @@ -92,7 +48,6 @@ private: sqlite3 *m_db; /* sqlite3 database */ String m_sql; /* sql stmt */ String m_buffer; /* temp buffer */ - Conditions m_conditions; /* select conditions */ }; |
