LCOV - code coverage report
Current view: top level - python - format.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 5 5 100.0 %
Date: 2024-04-28 01:25:40 Functions: 5 7 71.4 %

          Line data    Source code
       1             : // SPDX-License-Identifier: BSD-3-Clause
       2             : // Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
       3             : /// @file
       4             : /// @author Jan-Lukas Wynen
       5             : #pragma once
       6             : 
       7             : #include <sstream>
       8             : #include <string>
       9             : 
      10             : #include "pybind11.h"
      11             : 
      12             : namespace scipp::python {
      13             : /// Format a string from all arguments.
      14         102 : template <class... Args> std::string format(Args &&...args) {
      15         102 :   std::ostringstream oss;
      16         102 :   (oss << ... << std::forward<Args>(args));
      17         204 :   return oss.str();
      18         102 : }
      19             : } // namespace scipp::python

Generated by: LCOV version 1.14