Mercurial > hg > orthanc
comparison OrthancServer/DatabaseWrapper.cpp @ 436:d51186bf7602
read access to metadata
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 15 May 2013 16:28:00 +0200 |
parents | ccf3a0a43dac |
children | 7bbe77cb9e12 |
comparison
equal
deleted
inserted
replaced
435:28ba73274919 | 436:d51186bf7602 |
---|---|
358 target = s.ColumnString(0); | 358 target = s.ColumnString(0); |
359 return true; | 359 return true; |
360 } | 360 } |
361 } | 361 } |
362 | 362 |
363 bool DatabaseWrapper::ListAvailableMetadata(std::list<MetadataType>& target, | |
364 int64_t id) | |
365 { | |
366 target.clear(); | |
367 | |
368 SQLite::Statement s(db_, SQLITE_FROM_HERE, "SELECT type FROM Metadata WHERE id=?"); | |
369 s.BindInt(0, id); | |
370 | |
371 while (s.Step()) | |
372 { | |
373 target.push_back(static_cast<MetadataType>(s.ColumnInt(0))); | |
374 } | |
375 | |
376 return true; | |
377 } | |
378 | |
379 | |
363 std::string DatabaseWrapper::GetMetadata(int64_t id, | 380 std::string DatabaseWrapper::GetMetadata(int64_t id, |
364 MetadataType type, | 381 MetadataType type, |
365 const std::string& defaultValue) | 382 const std::string& defaultValue) |
366 { | 383 { |
367 std::string s; | 384 std::string s; |