Added delete support to the CRUD system.
This commit is contained in:
parent
36f5153091
commit
8c20bd6a02
8 changed files with 230 additions and 89 deletions
|
|
@ -52,25 +52,26 @@ Params::~Params()
|
|||
deleteValues();
|
||||
}
|
||||
|
||||
void Params::addText(const char *data, Oid oid)
|
||||
Param Params::addText(const char *data, Oid oid)
|
||||
{
|
||||
m_paramTypes.push_back(oid);
|
||||
m_paramValues.push_back(data);
|
||||
m_paramLengths.push_back(data ? strlen(data) + 1 : 0);
|
||||
m_paramFormats.push_back(0);
|
||||
return Param(*this, m_paramValues.size() - 1);
|
||||
}
|
||||
|
||||
void Params::add(const QString &s, Oid oid)
|
||||
Param Params::add(const QString &s, Oid oid)
|
||||
{
|
||||
auto ba = s.toUtf8();
|
||||
const int len = ba.size();
|
||||
char * p = new char[len+1];
|
||||
std::memcpy(p, ba.data(), len);
|
||||
p[len] = 0;
|
||||
addText(p, oid);
|
||||
return addText(p, oid);
|
||||
}
|
||||
|
||||
void Params::add(const char *data, Oid oid)
|
||||
Param Params::add(const char *data, Oid oid)
|
||||
{
|
||||
char * p = nullptr;
|
||||
int len = 0;
|
||||
|
|
@ -80,11 +81,12 @@ void Params::add(const char *data, Oid oid)
|
|||
std::memcpy(p, data, len);
|
||||
p[len] = 0;
|
||||
}
|
||||
return addText(p, oid);
|
||||
|
||||
m_paramTypes.push_back(oid);
|
||||
m_paramValues.push_back(p);
|
||||
m_paramLengths.push_back(len);
|
||||
m_paramFormats.push_back(0);
|
||||
// m_paramTypes.push_back(oid);
|
||||
// m_paramValues.push_back(p);
|
||||
// m_paramLengths.push_back(len);
|
||||
// m_paramFormats.push_back(0);
|
||||
}
|
||||
|
||||
//void Params::addBinary(const char *data, int length, Oid oid)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue