test_string_traits.h 662 B

123456789101112131415161718192021
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef CRDTP_TEST_STRING_TRAITS_H_
  5. #include "protocol_core.h"
  6. namespace crdtp {
  7. // Either real string traits or dummy string traits are going to be used
  8. // depending on whether this is built standalone or with embedder.
  9. template <>
  10. struct ProtocolTypeTraits<std::string> {
  11. static bool Deserialize(DeserializerState* state, std::string* value);
  12. static void Serialize(const std::string& value, std::vector<uint8_t>* bytes);
  13. };
  14. } // namespace crdtp
  15. #endif // CRDTP_TEST_STRING_TRAITS_H_