LCOV - code coverage report
Current view: top level - source/common/router - string_accessor_impl.h (source / functions) Hit Total Coverage
Test: coverage.dat Lines: 2 8 25.0 %
Date: 2024-01-05 06:35:25 Functions: 2 4 50.0 %

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include "envoy/router/string_accessor.h"
       4             : 
       5             : namespace Envoy {
       6             : namespace Router {
       7             : 
       8             : class StringAccessorImpl : public StringAccessor {
       9             : public:
      10           1 :   StringAccessorImpl(absl::string_view value) : value_(value) {}
      11             : 
      12             :   // StringAccessor
      13           3 :   absl::string_view asString() const override { return value_; }
      14             : 
      15             :   // FilterState::Object
      16           0 :   ProtobufTypes::MessagePtr serializeAsProto() const override {
      17           0 :     auto message = std::make_unique<ProtobufWkt::StringValue>();
      18           0 :     message->set_value(value_);
      19           0 :     return message;
      20           0 :   }
      21             : 
      22           0 :   absl::optional<std::string> serializeAsString() const override { return value_; }
      23             : 
      24             : private:
      25             :   std::string value_;
      26             : };
      27             : 
      28             : } // namespace Router
      29             : } // namespace Envoy

Generated by: LCOV version 1.15