| 31 | namespace internal { |
| 32 | |
| 33 | std::string Bitmap::ToString() const { |
| 34 | std::string out(length_ + ((length_ - 1) / 8), ' '); |
| 35 | for (int64_t i = 0; i < length_; ++i) { |
| 36 | out[i + (i / 8)] = GetBit(i) ? '1' : '0'; |
| 37 | } |
| 38 | return out; |
| 39 | } |
| 40 | |
| 41 | std::string Bitmap::Diff(const Bitmap& other) const { |
| 42 | auto this_buf = std::make_shared<Buffer>(data_, length_); |