LCOV - code coverage report
Current view: top level - pbes/include/mcrl2/pbes/tools - txt2pbes.h (source / functions) Hit Total Coverage
Test: mcrl2_coverage.info.cleaned Lines: 0 14 0.0 %
Date: 2024-04-13 03:38:08 Functions: 0 1 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : // Author(s): Wieger Wesselink
       2             : // Copyright: see the accompanying file COPYING or copy at
       3             : // https://github.com/mCRL2org/mCRL2/blob/master/COPYING
       4             : //
       5             : // Distributed under the Boost Software License, Version 1.0.
       6             : // (See accompanying file LICENSE_1_0.txt or copy at
       7             : // http://www.boost.org/LICENSE_1_0.txt)
       8             : //
       9             : /// \file mcrl2/pbes/tools/txt2pbes.h
      10             : /// \brief add your file description here.
      11             : 
      12             : #ifndef MCRL2_PBES_TOOLS_TXT2PBES_H
      13             : #define MCRL2_PBES_TOOLS_TXT2PBES_H
      14             : 
      15             : #include "mcrl2/pbes/txt2pbes.h"
      16             : 
      17             : namespace mcrl2 {
      18             : 
      19             : namespace pbes_system {
      20             : 
      21           0 : void txt2pbes(const std::string& input_filename,
      22             :               const std::string& output_filename,
      23             :               const utilities::file_format& output_format,
      24             :               bool normalize
      25             :              )
      26             : {
      27           0 :   pbes p;
      28           0 :   if (input_filename.empty())
      29             :   {
      30             :     //parse specification from stdin
      31           0 :     mCRL2log(log::verbose) << "reading input from stdin..." << std::endl;
      32           0 :     p = txt2pbes(std::cin, normalize);
      33             :   }
      34             :   else
      35             :   {
      36             :     //parse specification from input filename
      37           0 :     mCRL2log(log::verbose) << "reading input from file '" <<  input_filename << "'..." << std::endl;
      38           0 :     std::ifstream instream(input_filename.c_str(), std::ifstream::in|std::ifstream::binary);
      39           0 :     if (!instream)
      40             :     {
      41           0 :       throw mcrl2::runtime_error("cannot open input file: " + input_filename);
      42             :     }
      43           0 :     p = txt2pbes(instream, normalize);
      44           0 :     instream.close();
      45           0 :   }
      46           0 :   save_pbes(p, output_filename, output_format);
      47           0 : }
      48             : 
      49             : } // namespace pbes_system
      50             : 
      51             : } // namespace mcrl2
      52             : 
      53             : #endif // MCRL2_PBES_TOOLS_TXT2PBES_H

Generated by: LCOV version 1.14