Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
IOException.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* IOException.cc (C) 2000-2018 */
9/* */
10/* Exception when an input/output error is detected. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/ArcanePrecomp.h"
15
16#include "arcane/utils/Iostream.h"
17#include "arcane/utils/IOException.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28IOException::
29IOException(const String& where)
30: Exception("IOException", where)
31{
32}
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37IOException::
38IOException(const String& where, const String& message)
39: Exception("IOException", where)
40, m_message(message)
41{
42}
43
44/*---------------------------------------------------------------------------*/
45/*---------------------------------------------------------------------------*/
46
47IOException::
48IOException(const TraceInfo& where)
49: Exception("IOException", where)
50{
51}
52
53/*---------------------------------------------------------------------------*/
54/*---------------------------------------------------------------------------*/
55
56IOException::
57IOException(const TraceInfo& where, const String& message)
58: Exception("IOException", where)
59, m_message(message)
60{
61}
62
63/*---------------------------------------------------------------------------*/
64/*---------------------------------------------------------------------------*/
65
66IOException::
67IOException(const IOException& ex)
68: Exception(ex)
69, m_message(ex.m_message)
70{
71}
72
73/*---------------------------------------------------------------------------*/
74/*---------------------------------------------------------------------------*/
75
76void IOException::
77explain(std::ostream& m) const
78{
79 if (!m_message.null())
80 m << "Message: " << m_message << '\n';
81}
82
83/*---------------------------------------------------------------------------*/
84/*---------------------------------------------------------------------------*/
85
86} // namespace Arcane
87
88/*---------------------------------------------------------------------------*/
89/*---------------------------------------------------------------------------*/
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --