/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014-2016 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
m_base.execute(sql.str(), result);
}
+
+int64_t TestSecurityManagerDatabase::get_author_id(const std::string &authorName)
+{
+ Sqlite3DBaseSelectResult result;
+ std::ostringstream sql;
+
+ if (!m_base.is_open())
+ m_base.open();
+
+ sql.clear();
+ sql.str("SELECT author_id FROM author where name=\"" + authorName + "\"");
+ m_base.execute(sql.str(), result);
+
+ if(result.rows.empty())
+ return 0;
+
+ std::istringstream os(result.rows[0][0]);
+ int64_t id;
+ os >> id;
+ return id;
+}
+