ARTS 2.5.11 (git: 725533f0)
arts.cc
Go to the documentation of this file.
1
10#include "arts.h"
11#include <unistd.h>
12#include <cstdlib>
13#include <stdexcept>
14#include "file.h"
15#include "messages.h"
16
25void arts_exit(int status) {
26 extern ofstream report_file;
27 extern String out_basename; // Basis for file name
28 ostringstream report_file_ext;
29
30 report_file_ext << ".rep";
32 add_basedir(out_basename + report_file_ext.str()));
33
34 exit(status);
35}
36
38
48 ostringstream os;
49
50 os << m << "\n";
51
54 extern String out_basename;
55 char *buf = getcwd(nullptr, 0);
56 os << "Detailed report file: " << buf << "/"
57 << add_basedir(out_basename + ".rep") << "\n";
58 free(buf);
59 }
60
61 os << "Stopping ARTS execution.\n"
62 << "Goodbye.\n";
63 out << os.str();
64
65 arts_exit(); // No argument means failure.
66}
void arts_exit_with_error_message(const String &m, ArtsOut &out)
Print error message and exit.
Definition arts.cc:47
void arts_exit(int status)
This is the exit function of ARTS.
Definition arts.cc:25
The global header file for ARTS.
const Verbosity & get_verbosity() const
Definition messages.h:74
Index get_screen_verbosity() const
Definition messages.h:48
Index get_file_verbosity() const
Definition messages.h:49
String add_basedir(const std::string_view path)
Definition file.cc:424
void cleanup_output_file(ofstream &file, const std::string_view name)
Closes the file.
Definition file.cc:95
This file contains basic functions to handle ASCII files.
String out_basename
The basename for the report file and for all other output files.
Definition messages.cc:25
ofstream report_file
The report file.
Definition messages.cc:28
Declarations having to do with the four output streams.