StdStringCanonOutput::StdStringCanonOutput(std::string* str) : CanonOutput(), str_(str) {
  cur_len_ = static_cast<int>(str_->size()); // Append to existing data.
  buffer_ = str_->empty() ? NULL : &(*str_)[0];
  buffer_len_ = static_cast<int>(str_->size());
}
StdStringCanonOutput::StdStringCanonOutput(std::string* str) : CanonOutput(), str_(str) {
  cur_len_ = static_cast<int>(str_->size());  
  buffer_ = str_->empty() ? NULL : &(*str_)[0];
  buffer_len_ = static_cast<int>(str_->size());
}