PLCnext API Documentation 25.0.2.69
EndOfStreamException.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/System/Commons/Exceptions/CommonException.hpp"
9
10namespace Arp { namespace System { namespace Commons { namespace Io
11{
12
15{
16public: // construction/destruction
17 template<typename... Args>
18 EndOfStreamException(const char* message, const Args& ... args);
19 EndOfStreamException(const String& message);
21 EndOfStreamException(const String& message, const Exception& innerException);
22 EndOfStreamException(String&& message, Exception&& innerException);
23 EndOfStreamException(const EndOfStreamException& arg) = default;
25 virtual ~EndOfStreamException(void) = default;
26
27protected: // overridden operations
28 Exception::Ptr Clone(void)const override;
29
30private: // deleted methods
31 EndOfStreamException& operator=(const EndOfStreamException& arg) = delete;
32};
33
35// inline methods of class EndOfStreamException
36
38template<typename... Args>
39inline EndOfStreamException::EndOfStreamException(const char* message, const Args& ... args)
40 : CommonException(ExceptionTypeId::IoEndOfStream, String::Format(message, args...))
41{
42}
43
44}}}} // end of namesapce Arp::System::Commons::Io
45
47// template specialization of EndOfStreamException formatter
48template<> struct fmt::formatter<Arp::System::Commons::Io::EndOfStreamException> : public fmt::ostream_formatter {};
This is the base class of all Arp exception classes.
Definition: Exception.hpp:21
std::unique_ptr< Exception > Ptr
The smart pointer type of this class.
Definition: Exception.hpp:27
This class represents the Arp String. The implementation is based on std::string.
Definition: String.hpp:39
This is the base class of common exception classes.
Definition: CommonException.hpp:18
This is the base class of all IO exceptions.
Definition: EndOfStreamException.hpp:15
Exception::Ptr Clone(void) const override
This operation clones this instance polymorpically as a deep copy.
Definition: EndOfStreamException.cpp:13
EndOfStreamException(const char *message, const Args &... args)
Constructs an EndOfStreamException instance.
Definition: EndOfStreamException.hpp:39
ExceptionTypeId
Specifies the type id of any exception derived by <see cref="CommonException".
Definition: ExceptionTypeId.hpp:15
Root namespace for the PLCnext API