Skip to content

Commit b375cef

Browse files
N-Dekkerhjmjohnson
authored andcommitted
STYLE: Do not abbreviate ExceptionObject parameter names (desc, loc)
Renamed the `ExceptionObject` constructor parameters for the description and the location of the exception. Also renamed the location parameters of derived exception classes. Following ITKSoftwareGuide, CodingStyleGuide, section Naming Conventions, which says: "Names are generally spelled out; use of abbreviations is discouraged."
1 parent 122bd35 commit b375cef

File tree

8 files changed

+18
-14
lines changed

8 files changed

+18
-14
lines changed

Modules/Core/Common/include/itkExceptionObject.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ class ITKCommon_EXPORT ExceptionObject : public std::exception
5858

5959
explicit ExceptionObject(std::string file,
6060
unsigned int lineNumber = 0,
61-
std::string desc = "None",
62-
std::string loc = {});
61+
std::string description = "None",
62+
std::string location = {});
6363

6464
/** Copy-constructor. */
6565
ExceptionObject(const ExceptionObject &) noexcept = default;

Modules/Core/Common/src/itkExceptionObject.cxx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,12 @@ class ExceptionObject::ExceptionData
6565
};
6666

6767

68-
ExceptionObject::ExceptionObject(std::string file, unsigned int lineNumber, std::string desc, std::string loc)
69-
: m_ExceptionData(std::make_shared<const ExceptionData>(std::move(file), lineNumber, std::move(desc), std::move(loc)))
68+
ExceptionObject::ExceptionObject(std::string file,
69+
unsigned int lineNumber,
70+
std::string description,
71+
std::string location)
72+
: m_ExceptionData(
73+
std::make_shared<const ExceptionData>(std::move(file), lineNumber, std::move(description), std::move(location)))
7074
{}
7175

7276

Modules/IO/ImageBase/include/itkImageFileReaderException.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class ITKIOImageBase_EXPORT ImageFileReaderException : public ExceptionObject
4040
ImageFileReaderException(std::string file,
4141
unsigned int line,
4242
std::string message = "Error in IO",
43-
std::string loc = {})
44-
: ExceptionObject(std::move(file), line, std::move(message), std::move(loc))
43+
std::string location = {})
44+
: ExceptionObject(std::move(file), line, std::move(message), std::move(location))
4545
{}
4646

4747
/** Has to have empty throw(). */

Modules/IO/ImageBase/include/itkImageFileWriter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ class ITKIOImageBase_EXPORT ImageFileWriterException : public ExceptionObject
4343
ImageFileWriterException(std::string file,
4444
unsigned int line,
4545
std::string message = "Error in IO",
46-
std::string loc = {})
47-
: ExceptionObject(std::move(file), line, std::move(message), std::move(loc))
46+
std::string location = {})
47+
: ExceptionObject(std::move(file), line, std::move(message), std::move(location))
4848
{}
4949

5050
/** Has to have empty throw(). */

Modules/IO/MeshBase/include/itkMeshFileReaderException.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ITKIOMeshBase_EXPORT MeshFileReaderException : public ExceptionObject
4444
MeshFileReaderException(std::string file,
4545
unsigned int line,
4646
std::string message = "Error in IO",
47-
std::string loc = {});
47+
std::string location = {});
4848
};
4949
} // end namespace itk
5050

Modules/IO/MeshBase/include/itkMeshFileWriterException.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ITKIOMeshBase_EXPORT MeshFileWriterException : public ExceptionObject
4444
MeshFileWriterException(std::string file,
4545
unsigned int line,
4646
std::string message = "Error in IO",
47-
std::string loc = {});
47+
std::string location = {});
4848
};
4949
} // end namespace itk
5050

Modules/IO/MeshBase/src/itkMeshFileReaderException.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ MeshFileReaderException::~MeshFileReaderException() noexcept = default;
2424
MeshFileReaderException::MeshFileReaderException(std::string file,
2525
unsigned int line,
2626
std::string message,
27-
std::string loc)
28-
: ExceptionObject(std::move(file), line, std::move(message), std::move(loc))
27+
std::string location)
28+
: ExceptionObject(std::move(file), line, std::move(message), std::move(location))
2929
{}
3030
} // namespace itk

Modules/IO/MeshBase/src/itkMeshFileWriterException.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ MeshFileWriterException::~MeshFileWriterException() noexcept = default;
2424
MeshFileWriterException::MeshFileWriterException(std::string file,
2525
unsigned int line,
2626
std::string message,
27-
std::string loc)
28-
: ExceptionObject(std::move(file), line, std::move(message), std::move(loc))
27+
std::string location)
28+
: ExceptionObject(std::move(file), line, std::move(message), std::move(location))
2929
{}
3030
} // namespace itk

0 commit comments

Comments
 (0)