comparison OrthancServer/DatabaseWrapper.cpp @ 187:8e673a65564d

refactoring of storing new instances
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 12 Nov 2012 17:29:11 +0100
parents baada606da3c
children 090cefdab1d1
comparison
equal deleted inserted replaced
186:f68c039b0571 187:8e673a65564d
276 } 276 }
277 277
278 void DatabaseWrapper::AttachFile(int64_t id, 278 void DatabaseWrapper::AttachFile(int64_t id,
279 const std::string& name, 279 const std::string& name,
280 const std::string& fileUuid, 280 const std::string& fileUuid,
281 size_t compressedSize, 281 uint64_t compressedSize,
282 size_t uncompressedSize, 282 uint64_t uncompressedSize,
283 CompressionType compressionType) 283 CompressionType compressionType)
284 { 284 {
285 SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO AttachedFiles VALUES(?, ?, ?, ?, ?, ?)"); 285 SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO AttachedFiles VALUES(?, ?, ?, ?, ?, ?)");
286 s.BindInt(0, id); 286 s.BindInt(0, id);
287 s.BindString(1, name); 287 s.BindString(1, name);
293 } 293 }
294 294
295 bool DatabaseWrapper::FindFile(int64_t id, 295 bool DatabaseWrapper::FindFile(int64_t id,
296 const std::string& name, 296 const std::string& name,
297 std::string& fileUuid, 297 std::string& fileUuid,
298 size_t& compressedSize, 298 uint64_t& compressedSize,
299 size_t& uncompressedSize, 299 uint64_t& uncompressedSize,
300 CompressionType& compressionType) 300 CompressionType& compressionType)
301 { 301 {
302 SQLite::Statement s(db_, SQLITE_FROM_HERE, 302 SQLite::Statement s(db_, SQLITE_FROM_HERE,
303 "SELECT uuid, compressedSize, uncompressedSize, compressionType FROM AttachedFiles WHERE id=? AND name=?"); 303 "SELECT uuid, compressedSize, uncompressedSize, compressionType FROM AttachedFiles WHERE id=? AND name=?");
304 s.BindInt(0, id); 304 s.BindInt(0, id);