Finish constructing the data structure with all the keys that have been added so far. Returns the keys in sorted order in "*keys" and stores the key/value pairs in "*kvmap"
| 166 | // been added so far. Returns the keys in sorted order in "*keys" |
| 167 | // and stores the key/value pairs in "*kvmap" |
| 168 | void Finish(const Options& options, std::vector<string>* keys, KVMap* kvmap) { |
| 169 | *kvmap = data_; |
| 170 | keys->clear(); |
| 171 | for (KVMap::const_iterator it = data_.begin(); it != data_.end(); ++it) { |
| 172 | keys->push_back(it->first); |
| 173 | } |
| 174 | data_.clear(); |
| 175 | Status s = FinishImpl(options, *kvmap); |
| 176 | ASSERT_TRUE(s.ok()) << s.ToString(); |
| 177 | } |
| 178 | |
| 179 | // Construct the data structure from the data in "data" |
| 180 | virtual Status FinishImpl(const Options& options, const KVMap& data) = 0; |