LCOV - code coverage report
Current view: top level - source/common/config - resource_name.h (source / functions) Hit Total Coverage
Test: coverage.dat Lines: 6 6 100.0 %
Date: 2024-01-05 06:35:25 Functions: 13 18 72.2 %

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include <string>
       4             : #include <vector>
       5             : 
       6             : #include "source/common/protobuf/protobuf.h"
       7             : 
       8             : namespace Envoy {
       9             : namespace Config {
      10             : 
      11             : /**
      12             :  * Get resource name from api type.
      13             :  */
      14        1019 : template <typename Current> std::string getResourceName() {
      15        1019 :   return createReflectableMessage(Current())->GetDescriptor()->full_name();
      16        1019 : }
      17             : 
      18             : /**
      19             :  * Get type url from api type.
      20             :  */
      21         768 : template <typename Current> std::string getTypeUrl() {
      22         768 :   return "type.googleapis.com/" + getResourceName<Current>();
      23         768 : }
      24             : 
      25             : } // namespace Config
      26             : } // namespace Envoy

Generated by: LCOV version 1.15