LCOV - code coverage report
Current view: top level - src/restart - StringInputStream.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 11 12 91.7 %
Date: 2025-07-17 01:28:37 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #include "StringInputStream.h"
      11             : 
      12             : #include "MooseError.h"
      13             : 
      14       19816 : StringInputStream::StringInputStream(std::unique_ptr<std::stringstream> stream)
      15       19816 :   : InputStream(), _stream(std::move(stream))
      16             : {
      17       19816 : }
      18             : 
      19             : std::shared_ptr<std::istream>
      20      409508 : StringInputStream::get() const
      21             : {
      22             :   mooseAssert(_stream, "Not valid");
      23             : 
      24      409508 :   std::shared_ptr<std::istream> stream = std::make_unique<std::istream>(_stream->rdbuf());
      25      409508 :   addSharedStream(stream);
      26      409508 :   return stream;
      27           0 : }
      28             : 
      29             : std::unique_ptr<std::stringstream>
      30       19812 : StringInputStream::release()
      31             : {
      32       19812 :   if (inUse())
      33           1 :     mooseError("StringInputStream::release(): Cannot release; still in use");
      34       19811 :   return std::move(_stream);
      35             : }

Generated by: LCOV version 1.14