comparison OrthancServer/DatabaseWrapper.cpp @ 238:e4148b0ab1d0

statistics URI
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 30 Nov 2012 16:09:24 +0100
parents 16a4ac70bd8a
children bd009f0b1931
comparison
equal deleted inserted replaced
237:16a4ac70bd8a 238:e4148b0ab1d0
737 737
738 signalRemainingAncestor_ = new Internals::SignalRemainingAncestor; 738 signalRemainingAncestor_ = new Internals::SignalRemainingAncestor;
739 db_.Register(signalRemainingAncestor_); 739 db_.Register(signalRemainingAncestor_);
740 db_.Register(new Internals::SignalFileDeleted(listener_)); 740 db_.Register(new Internals::SignalFileDeleted(listener_));
741 } 741 }
742
743 uint64_t DatabaseWrapper::GetResourceCount(ResourceType resourceType)
744 {
745 SQLite::Statement s(db_, SQLITE_FROM_HERE,
746 "SELECT COUNT(*) FROM Resources WHERE resourceType=?");
747 s.BindInt(0, resourceType);
748
749 if (!s.Step())
750 {
751 throw OrthancException(ErrorCode_InternalError);
752 }
753
754 int64_t c = s.ColumnInt(0);
755 assert(!s.Step());
756
757 return c;
758 }
742 } 759 }