2020-03-18 Fred Gleason <fredg@paravelsystems.com>

* Added a 'FEED_IMAGES' table to the database.
	* Added 'feed_image_test' in 'tests/'.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2020-05-12 10:04:04 -04:00
parent 18e82cfdbe
commit 434c6c8070
13 changed files with 418 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
//
// Escape non-valid characters in a string.
//
// (C) Copyright 2002-2005,2016-2017 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@@ -113,3 +113,21 @@ QString RDEscapeShellString(QString str)
{
return "\""+str.replace("$","\\$")+"\"";
}
QString RDEscapeBlob(const QByteArray &data)
{
return RDEscapeBlob(data.constData(),data.length());
}
QString RDEscapeBlob(const char *data,size_t len)
{
QString ret="x'";
for(unsigned i=0;i<len;i++) {
ret+=QString().sprintf("%02x",0xff&data[i]);
}
return ret+"'";
}