+ /// Amount should range from 0 to 1000). If the user cancels the operation,
+ /// this returns true, false otherwise.
+ bool progress(unsigned Amount);
+
+ /// progress - Same as the method above, but this performs the division for
+ /// you, and helps you avoid overflow if you are dealing with largish
+ /// numbers.
+ bool progress(unsigned Current, unsigned Maximum) {
+ assert(Maximum != 0 &&
+ "Shouldn't be doing work if there is nothing to do!");
+ return progress(Current*uint64_t(1000UL)/Maximum);
+ }