Esempio n. 1
0
extern "C" ppk_error setEntry(const ppk_entry* entry, const ppk_data* edata, unsigned int flags)
{
	QString generatedKey;
	if (generateKey(entry, generatedKey) == PPK_FALSE)
		return PPK_UNKNOWN_ENTRY_TYPE;
	
	if (edata->type == ppk_string)
		return setPassword(generatedKey, edata->string, flags);
	else if (edata->type == ppk_blob)
		return setBlob(generatedKey, edata->blob.data, edata->blob.size, flags);
	else
		return PPK_UNKNOWN_ENTRY_TYPE;
}
Esempio n. 2
0
bool ConfigManager::updateConfigBase(int32_t key, const std::string& value, const std::string& type, int32_t section)
{
	if (m_spConfig == nullptr)
	{
		return false;
	}
	WriteLock writeLock(*m_spProcessMutex);
	m_spConfig->open();
	std::string updateString = SQLiteSqlString::updateString(m_tableName.c_str(), "data,type", CStringManager::Format("key='%d_%d'", section, key));
	auto prepare = m_spConfig->preparedCreator(updateString);
	prepare.setBlob(0, value);
	prepare.setString(1, type);
	bool res = m_spConfig->execute(prepare).empty();
	m_spConfig->close();
	return res;
}
Esempio n. 3
0
	// Setup entity fields
	void Fish::setupFields()
	{
		// Set table
		setTable("fish");
		// Add fields
		addField("fish_id");
		addField("best_video_id");
		addField("best_frame");
		//addField("best_bounding_box");
		//addField("best_contour");
		addField("best_bb_cc");
		addField("component_id");
		// Set key
		addKey("fish_id");
		// Set blob
		setBlob("best_bb_cc");
		// Add read modifiers for polygon
		//addReadModifier("best_bounding_box", "AsText(best_bounding_box) AS best_bounding_box");
		//addReadModifier("best_contour", "AsText(best_contour) AS best_contour");
		// Add write modifiers for polygon
		//addWriteModifier("best_bounding_box", "GeomFromText(", ")");
		//addWriteModifier("best_contour", "GeomFromText(", ")");
	}
Esempio n. 4
0
    void PreparedStatement::setBlob(const std::string &paramName, const Blob &value)
    {

        setBlob(sqlite3_bind_parameter_index(d->stmt, paramName.c_str()), value);
    }