gVirtualXRay  2.0.10
VirtualX-RayImagingLibraryonGPU
FileDoesNotExistException.inl
Go to the documentation of this file.
1 /*
2 
3 Copyright (c) 2014, Dr Franck P. Vidal (franck.p.vidal@fpvidal.net),
4 http://www.fpvidal.net/
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without modification,
8 are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11 this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14 this list of conditions and the following disclaimer in the documentation and/or
15 other materials provided with the distribution.
16 
17 3. Neither the name of the Bangor University nor the names of its contributors
18 may be used to endorse or promote products derived from this software without
19 specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 
32 */
33 
34 
63 //******************************************************************************
64 // Include
65 //******************************************************************************
66 #include <sstream>
67 
68 
69 //******************************************************************************
70 // namespace
71 //******************************************************************************
72 namespace gVirtualXRay {
73 
74 
75 //-----------------------------------------------------------------------------------------
77  const char* aFunctionName,
78  int anErrorLine,
79  const char* aNameOfFileToOpen):
80 //-----------------------------------------------------------------------------------------
81  Exception(aFileName, aFunctionName, anErrorLine)
82 //-----------------------------------------------------------------------------------------
83 {
84  std::stringstream error_message;
85  error_message << "Error: cannot open the file \"" << aNameOfFileToOpen << "\"" << std::endl;
86  error_message << "\t- in File: " << aFileName << std::endl;
87  error_message << "\t- in Function: " << aFunctionName << std::endl;
88  error_message << "\t- at Line: " << anErrorLine << std::endl;
89 
90  m_error_message = error_message.str();
91 }
92 
93 
94 //------------------------------------------------------------------------------------------------
96  const char* aFunctionName,
97  int anErrorLine,
98  const std::string& aNameOfFileToOpen):
99 //------------------------------------------------------------------------------------------------
100  Exception(aFileName, aFunctionName, anErrorLine)
101 //------------------------------------------------------------------------------------------------
102 {
103  std::stringstream error_message;
104  error_message << "Error: cannot open the file \"" << aNameOfFileToOpen << "\"" << std::endl;
105  error_message << "\t- in File: " << aFileName << std::endl;
106  error_message << "\t- in Function: " << aFunctionName << std::endl;
107  error_message << "\t- at Line: " << anErrorLine << std::endl;
108 
109  m_error_message = error_message.str();
110 }
111 
112 
113 } // namespace gVirtualXRay
FileDoesNotExistException(const char *aFileName, const char *aFunctionName, int anErrorLine, const char *aNameOfFileToOpen)
Constructor.
std::string m_error_message
The error message.
Definition: Exception.h:168
Exception is a class to handle exceptions.
Definition: Exception.h:109