comparison OrthancServer/DatabaseWrapper.cpp @ 1238:6c07108ff1e2

cleaning
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 05 Dec 2014 16:14:57 +0100
parents 0f3716b88af7
children 92c6b3b57699
comparison
equal deleted inserted replaced
1237:0f3716b88af7 1238:6c07108ff1e2
432 target.push_back(static_cast<MetadataType>(s.ColumnInt(0))); 432 target.push_back(static_cast<MetadataType>(s.ColumnInt(0)));
433 } 433 }
434 } 434 }
435 435
436 436
437 std::string DatabaseWrapper::GetMetadata(int64_t id,
438 MetadataType type,
439 const std::string& defaultValue)
440 {
441 std::string s;
442 if (LookupMetadata(s, id, type))
443 {
444 return s;
445 }
446 else
447 {
448 return defaultValue;
449 }
450 }
451
452
453
454 void DatabaseWrapper::AddAttachment(int64_t id, 437 void DatabaseWrapper::AddAttachment(int64_t id,
455 const FileInfo& attachment) 438 const FileInfo& attachment)
456 { 439 {
457 SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO AttachedFiles VALUES(?, ?, ?, ?, ?, ?, ?, ?)"); 440 SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO AttachedFiles VALUES(?, ?, ?, ?, ?, ?, ?, ?)");
458 s.BindInt64(0, id); 441 s.BindInt64(0, id);