|
|
@ -7,13 +7,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
namespace Compiler
|
|
|
|
namespace Compiler
|
|
|
|
{
|
|
|
|
{
|
|
|
|
class ContextRestore;
|
|
|
|
class ContextOverride;
|
|
|
|
/// \brief Error handler implementation: Write errors into logging stream
|
|
|
|
/// \brief Error handler implementation: Write errors into logging stream
|
|
|
|
|
|
|
|
|
|
|
|
class StreamErrorHandler : public ErrorHandler
|
|
|
|
class StreamErrorHandler : public ErrorHandler
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::string mContext;
|
|
|
|
std::string mContext;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
friend class ContextOverride;
|
|
|
|
// not implemented
|
|
|
|
// not implemented
|
|
|
|
|
|
|
|
|
|
|
|
StreamErrorHandler (const StreamErrorHandler&);
|
|
|
|
StreamErrorHandler (const StreamErrorHandler&);
|
|
|
@ -27,7 +28,7 @@ namespace Compiler
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
ContextRestore setContext(const std::string& context, bool restore = false);
|
|
|
|
void setContext(const std::string& context);
|
|
|
|
|
|
|
|
|
|
|
|
// constructors
|
|
|
|
// constructors
|
|
|
|
|
|
|
|
|
|
|
@ -35,16 +36,17 @@ namespace Compiler
|
|
|
|
///< constructor
|
|
|
|
///< constructor
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class ContextRestore
|
|
|
|
class ContextOverride
|
|
|
|
{
|
|
|
|
{
|
|
|
|
StreamErrorHandler* mHandler;
|
|
|
|
StreamErrorHandler& mHandler;
|
|
|
|
const std::string mContext;
|
|
|
|
const std::string mContext;
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
ContextRestore (StreamErrorHandler* handler, const std::string& context);
|
|
|
|
ContextOverride (StreamErrorHandler& handler, const std::string& context);
|
|
|
|
|
|
|
|
|
|
|
|
ContextRestore (ContextRestore&& other);
|
|
|
|
ContextOverride (const ContextOverride&) = delete;
|
|
|
|
|
|
|
|
ContextOverride& operator= (const ContextOverride&) = delete;
|
|
|
|
|
|
|
|
|
|
|
|
~ContextRestore();
|
|
|
|
~ContextOverride();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|