use enum class for status
Change-Id: Iaba23e0754335a7fecec2d6c4b3446988b2fd9d0
diff --git a/src/ca-detail/ca-sqlite.cpp b/src/ca-detail/ca-sqlite.cpp
index 7d0444a..8312eaa 100644
--- a/src/ca-detail/ca-sqlite.cpp
+++ b/src/ca-detail/ca-sqlite.cpp
@@ -126,7 +126,7 @@
if (statement.step() == SQLITE_ROW) {
Name caName(statement.getBlock(2));
- int status = statement.getInt(3);
+ Status status = static_cast<Status>(statement.getInt(3));
std::string challengeStatus = statement.getString(4);
security::v2::Certificate cert(statement.getBlock(6));
std::string challengeType = statement.getString(7);
@@ -179,7 +179,7 @@
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?))_SQLTEXT_");
statement.bind(1, request.m_requestId, SQLITE_TRANSIENT);
statement.bind(2, request.m_caPrefix.wireEncode(), SQLITE_TRANSIENT);
- statement.bind(3, request.m_status);
+ statement.bind(3, static_cast<int>(request.m_status));
statement.bind(4, request.m_challengeStatus, SQLITE_TRANSIENT);
statement.bind(5, request.m_cert.getKeyName().wireEncode(),
SQLITE_TRANSIENT);
@@ -205,7 +205,7 @@
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?))_SQLTEXT_");
statement.bind(1, request.m_requestId, SQLITE_TRANSIENT);
statement.bind(2, request.m_caPrefix.wireEncode(), SQLITE_TRANSIENT);
- statement.bind(3, request.m_status);
+ statement.bind(3, static_cast<int>(request.m_status));
statement.bind(4, request.m_challengeStatus, SQLITE_TRANSIENT);
statement.bind(5, request.m_cert.getKeyName().wireEncode(),
SQLITE_TRANSIENT);
@@ -231,7 +231,7 @@
SET status = ?, challenge_status = ?, challenge_type = ?, challenge_secrets = ?,
challenge_tp = ?, remaining_tries = ?, remaining_time = ?, request_type = ?
WHERE request_id = ?)_SQLTEXT_");
- statement.bind(1, request.m_status);
+ statement.bind(1, static_cast<int>(request.m_status));
statement.bind(2, request.m_challengeStatus, SQLITE_TRANSIENT);
statement.bind(3, request.m_challengeType, SQLITE_TRANSIENT);
statement.bind(4, convertJson2String(request.m_challengeSecrets), SQLITE_TRANSIENT);
@@ -258,7 +258,7 @@
while (statement.step() == SQLITE_ROW) {
std::string requestId = statement.getString(1);
Name caName(statement.getBlock(2));
- int status = statement.getInt(3);
+ Status status = static_cast<Status>(statement.getInt(3));
std::string challengeStatus = statement.getString(4);
security::v2::Certificate cert(statement.getBlock(6));
std::string challengeType = statement.getString(7);
@@ -289,7 +289,7 @@
while (statement.step() == SQLITE_ROW) {
std::string requestId = statement.getString(1);
Name caName(statement.getBlock(2));
- int status = statement.getInt(3);
+ Status status = static_cast<Status>(statement.getInt(3));
std::string challengeStatus = statement.getString(4);
security::v2::Certificate cert(statement.getBlock(6));
std::string challengeType = statement.getString(7);