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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.61/] [tools/] [src/] [librtools/] [RosPrintBvi.hpp] - Blame information for rev 10

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

Line No. Rev Author Line
1 10 wfjm
// $Id: RosPrintBvi.hpp 366 2011-03-05 14:55:15Z mueller $
2
//
3
// Copyright 2011- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4
//
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
// 2011-03-05   366   1.0    Initial version
17
// ---------------------------------------------------------------------------
18
 
19
/*!
20
  \file
21
  \version $Id: RosPrintBvi.hpp 366 2011-03-05 14:55:15Z mueller $
22
  \brief   Declaration of class RosPrintBvi .
23
*/
24
 
25
#ifndef included_Retro_RosPrintBvi
26
#define included_Retro_RosPrintBvi 1
27
 
28
#include <cstdint>
29
#include <ostream>
30
#include <string>
31
 
32
namespace Retro {
33
 
34
  class RosPrintBvi {
35
    public:
36
      explicit      RosPrintBvi(uint8_t val, size_t base=2, size_t nbit=8);
37
      explicit      RosPrintBvi(uint16_t val, size_t base=2, size_t nbit=16);
38
      explicit      RosPrintBvi(uint32_t val, size_t base=2, size_t nbit=32);
39
 
40
      void          Print(std::ostream& os) const;
41
      void          Print(std::string& os) const;
42
 
43
  protected:
44
      void          Convert(char* pbuf) const;
45
 
46
  protected:
47
      uint32_t      fVal;                   //!< value to be printed
48
      size_t        fBase;                  //!< base: 2,8, or 16
49
      size_t        fNbit;                  //!< number of bits to print
50
 
51
  };
52
 
53
  std::ostream&     operator<<(std::ostream& os, const RosPrintBvi& obj);
54
  std::string&      operator<<(std::string&  os, const RosPrintBvi& obj);
55
 
56
} // end namespace Retro
57
 
58
#if !(defined(Retro_NoInline) || defined(Retro_RosPrintBvi_NoInline))
59
#include "RosPrintBvi.ipp"
60
#endif
61
 
62
#endif

powered by: WebSVN 2.1.0

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