OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [tools/] [src/] [librtools/] [RerrMsg.hpp] - Blame information for rev 36

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 wfjm
// $Id: RerrMsg.hpp 493 2013-03-01 21:02:33Z mueller $
2 10 wfjm
//
3 19 wfjm
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4 10 wfjm
//
5
// This program is free software; you may redistribute and/or modify it under
6
// the terms of the GNU General Public License as published by the Free
7
// Software Foundation, either version 2, or at your option any later version.
8
//
9
// This program is distributed in the hope that it will be useful, but
10
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
// for complete details.
13
// 
14
// Revision History: 
15
// Date         Rev Version  Comment
16 19 wfjm
// 2013-01-12   474   1.2    add meth+text and meth+text+errnum ctors
17 10 wfjm
// 2011-02-06   359   1.1    use references in interface
18
// 2011-01-15   356   1.0    Initial version
19
// ---------------------------------------------------------------------------
20
 
21
 
22
/*!
23
  \file
24 19 wfjm
  \version $Id: RerrMsg.hpp 493 2013-03-01 21:02:33Z mueller $
25 10 wfjm
  \brief   Declaration of class RerrMsg.
26
*/
27
 
28
#ifndef included_Retro_RerrMsg
29
#define included_Retro_RerrMsg 1
30
 
31
#include <string>
32
#include <ostream>
33
 
34
namespace Retro {
35
 
36
  class RerrMsg {
37
    public:
38
                    RerrMsg();
39
                    RerrMsg(const RerrMsg& rhs);
40 19 wfjm
                    RerrMsg(const std::string& meth, const std::string& text);
41
                    RerrMsg(const std::string& meth, const std::string& text,
42
                            int errnum);
43 10 wfjm
                    ~RerrMsg();
44
 
45
      void          Init(const std::string& meth, const std::string& text);
46
      void          InitErrno(const std::string& meth,
47
                              const std::string& text, int errnum);
48
      void          InitPrintf(const std::string& meth,
49
                               const char* format, ...);
50
 
51
      void          SetMeth(const std::string& meth);
52
      void          SetText(const std::string& text);
53
 
54
      void          Prepend(const std::string& meth);
55
      void          Append(const std::string& text);
56
      void          AppendErrno(int errnum);
57
      void          AppendPrintf(const char* format, ...);
58
 
59
      const std::string& Meth() const;
60
      const std::string& Text() const;
61
      std::string   Message() const;
62
 
63 19 wfjm
      void          Swap(RerrMsg& rhs);
64 10 wfjm
 
65
      RerrMsg&      operator=(const RerrMsg& rhs);
66
                    operator std::string() const;
67
 
68
    protected:
69
      std::string   fMeth;                  //!< originating method
70
      std::string   fText;                  //!< message text
71
  };
72
 
73
  std::ostream&     operator<<(std::ostream& os, const RerrMsg& obj);
74
 
75
} // end namespace Retro
76
 
77
#include "RerrMsg.ipp"
78
 
79
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.