libzypp: zypp::base::DrunkenBishop Class Reference

libzypp 17.38.14

zypp::base::DrunkenBishop Class Reference

Random art fingerprint visualization Visualize fingerprint data on a [17x9] (SSH) or [19x11] (GPG) or custom sized board. More...

`#include <zypp-common/base/DrunkenBishop.h>`

## Classes
class | Impl
| DrunkenBishop implementation. More...

## Public Types
enum | OptionBits { USE_COLOR = (1<<0) }

## Public Member Functions
| DrunkenBishop ()
| Default ctor: empty board (1x1).
| DrunkenBishop (const std::string &data_r, const std::string &title_r=std::string())
| Ctor taking a data string (and optional title) and using a default (SSH/GPG) board.
| DrunkenBishop (const std::string &data_r, const std::string &title_r, unsigned height_r)
| Ctor also taking a desired board height (even value is incremented, width is 2*height-1).
| DrunkenBishop (const std::string &data_r, unsigned height_r)
| DrunkenBishop (const std::string &data_r, const std::string &title_r, unsigned height_r, unsigned width_r)
| Ctor also taking a desired board height and width (even values are incremented).
| DrunkenBishop (const std::string &data_r, unsigned height_r, unsigned width_r)
| ~DrunkenBishop ()
| Dtor.
| ZYPP_DECLARE_FLAGS (Options, OptionBits)
std::ostream & | dumpOn (std::ostream &str, Options options_r=Options()) const
| Render board to steam.
std::ostream & | dumpOn (std::ostream &str, const std::string &prefix_r, Options options_r=Options()) const
std::string | asString (Options options_r=Options()) const
| Render board as string.
std::string | asString (const std::string &prefix_r, Options options_r=Options()) const
std::vector< std::string > | asLines (Options options_r=Options()) const
| Render to an array of lines.
std::vector< std::string > | asLines (const std::string &prefix_r, Options options_r=Options()) const

## Private Attributes
RW_pointer< Impl > | _pimpl
| Implementation class.

## Friends
std::ostream & | operator<< (std::ostream &str, const DrunkenBishop &obj)
| relates: DrunkenBishop Stream output

## Detailed Description

Random art fingerprint visualization Visualize fingerprint data on a [17x9] (SSH) or [19x11] (GPG) or custom sized board.

The default board size and layout depends on the data string length (above 32 the GPG board and layout is used).

The data string should be an even sized HEX string, otherwise it will be 0-padded.

All ctor calls may throw std::invalid_argument.

[SuSE Package Signing Key <build@suse.de>]
+------[Title]------+
| . . ^ | fpr FEAB502539D846DB2C0961CA70AF9E8139DB7C82
| : : . | id 70AF9E8139DB7C82
| ^ ^ . | cre 1481108255 Wed Dec 7 11:57:35 2016
| ^ . l i | exp 1607252255 Sun Dec 6 11:57:35 2020
| : ^ . f : | ttl 992
| ? ^ .Sl | rpm 39db7c82-5847eb1f
| E i ... |
| ^ .. |
| . . |
| . . |
| .... |
+----[39DB7C82]-----+
zypp::Package
Package interface.
Definition Package.h:34

Based on https://github.com/atoponce/keyart, the development location for the Debian signing-party package. We try to use the same charset and heatmap. See also http://dirk-loss.de/sshvis/drunken_bishop.pdf.

Definition at line 61 of file DrunkenBishop.h.

## Member Enumeration Documentation

## ◆ OptionBits

enum zypp::base::DrunkenBishop::OptionBits

Enumerator
USE_COLOR | use colors

Definition at line 91 of file DrunkenBishop.h.

## Constructor & Destructor Documentation

## ◆ DrunkenBishop() [1/6]

zypp::base::DrunkenBishop::DrunkenBishop | ( |  | ) |

Default ctor: empty board (1x1).

Definition at line 373 of file DrunkenBishop.cc.

## ◆ DrunkenBishop() [2/6]

zypp::base::DrunkenBishop::DrunkenBishop | ( | const std::string & | data_r,
|  | const std::string & | title_r = std::string() )

Ctor taking a data string (and optional title) and using a default (SSH/GPG) board.

Definition at line 377 of file DrunkenBishop.cc.

## ◆ DrunkenBishop() [3/6]

zypp::base::DrunkenBishop::DrunkenBishop | ( | const std::string & | data_r,
|  | const std::string & | title_r,
|  | unsigned | height_r )

Ctor also taking a desired board height (even value is incremented, width is 2*height-1).

Definition at line 381 of file DrunkenBishop.cc.

## ◆ DrunkenBishop() [4/6]

zypp::base::DrunkenBishop::DrunkenBishop | ( | const std::string & | data_r,
|  | unsigned | height_r )
| inline

Definition at line 75 of file DrunkenBishop.h.

## ◆ DrunkenBishop() [5/6]

zypp::base::DrunkenBishop::DrunkenBishop | ( | const std::string & | data_r,
|  | const std::string & | title_r,
|  | unsigned | height_r,
|  | unsigned | width_r )

Ctor also taking a desired board height and width (even values are incremented).

Definition at line 385 of file DrunkenBishop.cc.

## ◆ DrunkenBishop() [6/6]

zypp::base::DrunkenBishop::DrunkenBishop | ( | const std::string & | data_r,
|  | unsigned | height_r,
|  | unsigned | width_r )
| inline

Definition at line 82 of file DrunkenBishop.h.

## ◆ ~DrunkenBishop()

zypp::base::DrunkenBishop::~DrunkenBishop | ( |  | ) |

Dtor.

Definition at line 389 of file DrunkenBishop.cc.

## Member Function Documentation

## ◆ ZYPP_DECLARE_FLAGS()

zypp::base::DrunkenBishop::ZYPP_DECLARE_FLAGS | ( | Options | ,
|  | OptionBits | )

## ◆ dumpOn() [1/2]

std::ostream & zypp::base::DrunkenBishop::dumpOn | ( | std::ostream & | str,
|  | Options | options_r = Options() ) const
| inline

Render board to steam.

Definition at line 97 of file DrunkenBishop.h.

## ◆ dumpOn() [2/2]

std::ostream & zypp::base::DrunkenBishop::dumpOn | ( | std::ostream & | str,
|  | const std::string & | prefix_r,
|  | Options | options_r = Options() ) const

Definition at line 392 of file DrunkenBishop.cc.

## ◆ asString() [1/2]

std::string zypp::base::DrunkenBishop::asString | ( | Options | options_r = Options() | ) | const
| inline

Render board as string.

Definition at line 103 of file DrunkenBishop.h.

## ◆ asString() [2/2]

std::string zypp::base::DrunkenBishop::asString | ( | const std::string & | prefix_r,
|  | Options | options_r = Options() ) const

Definition at line 395 of file DrunkenBishop.cc.

## ◆ asLines() [1/2]

std::vector< std::string > zypp::base::DrunkenBishop::asLines | ( | Options | options_r = Options() | ) | const
| inline

Render to an array of lines.

Definition at line 109 of file DrunkenBishop.h.

## ◆ asLines() [2/2]

std::vector< std::string > zypp::base::DrunkenBishop::asLines | ( | const std::string & | prefix_r,
|  | Options | options_r = Options() ) const

Definition at line 402 of file DrunkenBishop.cc.

## Friends And Related Symbol Documentation

## ◆ operator<<

std::ostream & operator<< | ( | std::ostream & | str,
|  | const DrunkenBishop & | obj )
| friend

relates: DrunkenBishop Stream output

Definition at line 123 of file DrunkenBishop.h.

## Member Data Documentation

## ◆ _pimpl

RW_pointer<Impl> zypp::base::DrunkenBishop::_pimpl
| private

Implementation class.

Pointer to implementation.

Definition at line 117 of file DrunkenBishop.h.

The documentation for this class was generated from the following files:

- zypp-common/base/DrunkenBishop.h
- zypp-common/base/DrunkenBishop.cc