Release version 0.22.40
[platform/core/appfw/pkgmgr-info.git] / src / server / sqlite_util_internal.c
index 513c175..84c9f4a 100644 (file)
@@ -19,3 +19,17 @@ inline void _save_column_str(sqlite3_stmt *stmt, int idx, char **str)
        if (val)
                *str = strdup(val);
 }
+
+void _save_column_bool(sqlite3_stmt *stmt, int idx, bool *bool_value)
+{
+       const char *val;
+
+       val = (const char *)sqlite3_column_text(stmt, idx);
+       if (!val)
+               return;
+
+       if (strcasecmp(val, "true") == 0)
+               *bool_value = true;
+       else if (strcasecmp(val, "false") == 0)
+               *bool_value = false;
+}