comparison OrthancServer/DatabaseWrapper.cpp @ 1006:649d47854314 lua-scripting

proper handling of metadata in Store
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 08 Jul 2014 15:11:00 +0200
parents 84513f2ee1f3
children badc14fee61f
comparison
equal deleted inserted replaced
1005:84b6d7bca6db 1006:649d47854314
1043 while (s.Step()) 1043 while (s.Step())
1044 { 1044 {
1045 result.push_back(s.ColumnInt64(0)); 1045 result.push_back(s.ColumnInt64(0));
1046 } 1046 }
1047 } 1047 }
1048
1049
1050 void DatabaseWrapper::GetAllMetadata(std::map<MetadataType, std::string>& result,
1051 int64_t id)
1052 {
1053 result.clear();
1054
1055 SQLite::Statement s(db_, SQLITE_FROM_HERE, "SELECT type, value FROM Metadata WHERE id=?");
1056 s.BindInt64(0, id);
1057
1058 while (s.Step())
1059 {
1060 MetadataType key = static_cast<MetadataType>(s.ColumnInt(0));
1061 result[key] = s.ColumnString(1);
1062 }
1063 }
1064
1048 } 1065 }