Lines Matching refs:c_str
100 string result = StringPrintf("CREATE TABLE IF NOT EXISTS %s%s", TABLE_NAME_PREFIX.c_str(), in getCreateSqlString()
101 reformatMetricId(metricId).c_str()); in getCreateSqlString()
102 result += StringPrintf("(%s INTEGER,%s INTEGER,%s INTEGER,", COLUMN_NAME_ATOM_TAG.c_str(), in getCreateSqlString()
103 COLUMN_NAME_EVENT_ELAPSED_CLOCK_NS.c_str(), in getCreateSqlString()
104 COLUMN_NAME_EVENT_WALL_CLOCK_NS.c_str()); in getCreateSqlString()
140 if (sqlite3_open(dbName.c_str(), &db) != SQLITE_OK) { in createTableIfNeeded()
147 sqlite3_exec(db, zSql.c_str(), nullptr, nullptr, &error); in createTableIfNeeded()
159 if (sqlite3_open(dbName.c_str(), &db) != SQLITE_OK) { in isEventCompatible()
163 string zSql = StringPrintf("PRAGMA table_info(metric_%s);", reformatMetricId(metricId).c_str()); in isEventCompatible()
169 ALOGE("Failed to check table schema for metric %lld: %s", (long long)metricId, err.c_str()); in isEventCompatible()
193 if (sqlite3_open(dbName.c_str(), &db) != SQLITE_OK) { in deleteTable()
197 string zSql = StringPrintf("DROP TABLE metric_%s", reformatMetricId(metricId).c_str()); in deleteTable()
199 sqlite3_exec(db, zSql.c_str(), nullptr, nullptr, &error); in deleteTable()
210 StorageManager::deleteFile(dbName.c_str()); in deleteDb()
216 if (sqlite3_open(dbName.c_str(), &db) == SQLITE_OK) { in getDb()
229 StringPrintf("INSERT INTO metric_%s VALUES", reformatMetricId(metricId).c_str()); in getInsertSqlStmt()
246 if (sqlite3_prepare_v2(db, result.c_str(), -1, stmt, nullptr) != SQLITE_OK) { in getInsertSqlStmt()
267 sqlite3_bind_text(*stmt, index, fieldValue.mValue.str_value.c_str(), -1, in getInsertSqlStmt()
287 if (sqlite3_open(dbName.c_str(), &db) != SQLITE_OK) { in insert()
300 ALOGW("Failed to generate prepared sql insert query %s", error.c_str()); in insert()
306 ALOGW("Failed to insert data to db: %s", error.c_str()); in insert()
318 if (sqlite3_open_v2(dbName.c_str(), &db, SQLITE_OPEN_READONLY, nullptr) != SQLITE_OK) { in query()
324 if (sqlite3_prepare_v2(db, zSql.c_str(), -1, &stmt, nullptr) != SQLITE_OK) { in query()
365 string zSql = StringPrintf("DELETE FROM %s%s WHERE %s <= %lld", TABLE_NAME_PREFIX.c_str(), in flushTtl()
366 reformatMetricId(metricId).c_str(), in flushTtl()
367 COLUMN_NAME_EVENT_WALL_CLOCK_NS.c_str(), (long long)ttlWallClockNs); in flushTtl()
370 sqlite3_exec(db, zSql.c_str(), nullptr, nullptr, &error); in flushTtl()
381 if (sqlite3_open(dbName.c_str(), &db) != SQLITE_OK) { in verifyIntegrityAndDeleteIfNecessary()
388 sqlite3_exec(db, zSql.c_str(), integrityCheckCallback, nullptr, &error); in verifyIntegrityAndDeleteIfNecessary()
401 if (sqlite3_prepare_v2(db, insertSql.c_str(), -1, stmt, nullptr) != SQLITE_OK) { in getDeviceInfoInsertStmt()
414 sqlite3_bind_text(*stmt, index, model.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
418 sqlite3_bind_text(*stmt, index, product.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
422 sqlite3_bind_text(*stmt, index, hardware.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
426 sqlite3_bind_text(*stmt, index, device.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
430 sqlite3_bind_text(*stmt, index, osBuild.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
434 sqlite3_bind_text(*stmt, index, fingerprint.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
438 sqlite3_bind_text(*stmt, index, brand.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
442 sqlite3_bind_text(*stmt, index, manufacturer.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
446 sqlite3_bind_text(*stmt, index, board.c_str(), -1, SQLITE_TRANSIENT); in getDeviceInfoInsertStmt()
455 if (sqlite3_open(dbName.c_str(), &db) != SQLITE_OK) { in updateDeviceInfoTable()
463 sqlite3_exec(db, dropTableSql.c_str(), nullptr, nullptr, nullptr); in updateDeviceInfoTable()
469 COLUMN_NAME_SDK_VERSION.c_str(), COLUMN_NAME_MODEL.c_str(), COLUMN_NAME_PRODUCT.c_str(), in updateDeviceInfoTable()
470 COLUMN_NAME_HARDWARE.c_str(), COLUMN_NAME_DEVICE.c_str(), COLUMN_NAME_BUILD.c_str(), in updateDeviceInfoTable()
471 COLUMN_NAME_FINGERPRINT.c_str(), COLUMN_NAME_BRAND.c_str(), in updateDeviceInfoTable()
472 COLUMN_NAME_MANUFACTURER.c_str(), COLUMN_NAME_BOARD.c_str()); in updateDeviceInfoTable()
473 if (sqlite3_exec(db, createTableSql.c_str(), nullptr, nullptr, nullptr) != SQLITE_OK) { in updateDeviceInfoTable()
475 ALOGW("Failed to create device info table %s", error.c_str()); in updateDeviceInfoTable()
482 ALOGW("Failed to generate device info prepared sql insert query %s", error.c_str()); in updateDeviceInfoTable()
490 ALOGW("Failed to insert data to device info table: %s", error.c_str()); in updateDeviceInfoTable()