text: /**
   * A MergeOperator for rocksdb that implements string append.
   * @author Deon Nicholas (dnicholas@fb.com)
   * Copyright 2013 Facebook
   *
   * The following only applies to changes made to this file as part of YugaByte development.
   *
   * Portions Copyright (c) YugaByte, Inc.
   *
   * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
   * in compliance with the License.  You may obtain a copy of the License at
   *
   * http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software distributed under the License
   * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
   * or implied.  See the License for the specific language governing permissions and limitations
   * under the License.
   *
   */
  
  #pragma once
  #include "yb/rocksdb/merge_operator.h"
  #include "yb/util/slice.h"
  
  namespace rocksdb {
  
  class StringAppendOperator : public AssociativeMergeOperator {
   public:
    // Constructor: specify delimiter
    explicit StringAppendOperator(char delim_char);
  
    virtual bool Merge(const Slice& key,
                       const Slice* existing_value,
                       const Slice& value,
                       std::string* new_value,
                       Logger* logger) const override;
  
    virtual const char* Name() const override;
  
   private:
    char delim_;         // The delimiter is inserted between elements
  
  };
  
  } // namespace rocksdb
  