comparison OrthancServer/DatabaseWrapper.cpp @ 233:c11273198cef

rename
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 30 Nov 2012 14:30:05 +0100
parents 5368bbe813cf
children 16a4ac70bd8a
comparison
equal deleted inserted replaced
232:5368bbe813cf 233:c11273198cef
379 void DatabaseWrapper::AddAttachment(int64_t id, 379 void DatabaseWrapper::AddAttachment(int64_t id,
380 const FileInfo& attachment) 380 const FileInfo& attachment)
381 { 381 {
382 SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO AttachedFiles VALUES(?, ?, ?, ?, ?, ?)"); 382 SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO AttachedFiles VALUES(?, ?, ?, ?, ?, ?)");
383 s.BindInt(0, id); 383 s.BindInt(0, id);
384 s.BindInt(1, attachment.GetFileType()); 384 s.BindInt(1, attachment.GetContentType());
385 s.BindString(2, attachment.GetUuid()); 385 s.BindString(2, attachment.GetUuid());
386 s.BindInt(3, attachment.GetCompressedSize()); 386 s.BindInt(3, attachment.GetCompressedSize());
387 s.BindInt(4, attachment.GetUncompressedSize()); 387 s.BindInt(4, attachment.GetUncompressedSize());
388 s.BindInt(5, attachment.GetCompressionType()); 388 s.BindInt(5, attachment.GetCompressionType());
389 s.Run(); 389 s.Run();
390 } 390 }
391 391
392 bool DatabaseWrapper::LookupAttachment(FileInfo& attachment, 392 bool DatabaseWrapper::LookupAttachment(FileInfo& attachment,
393 int64_t id, 393 int64_t id,
394 FileType contentType) 394 FileContentType contentType)
395 { 395 {
396 SQLite::Statement s(db_, SQLITE_FROM_HERE, 396 SQLite::Statement s(db_, SQLITE_FROM_HERE,
397 "SELECT uuid, uncompressedSize, compressionType, compressedSize FROM AttachedFiles WHERE id=? AND fileType=?"); 397 "SELECT uuid, uncompressedSize, compressionType, compressedSize FROM AttachedFiles WHERE id=? AND fileType=?");
398 s.BindInt(0, id); 398 s.BindInt(0, id);
399 s.BindInt(1, contentType); 399 s.BindInt(1, contentType);