libzypp: zypp/base/SerialNumber.cc Source File

libzypp 17.38.8

SerialNumber.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#include <iostream>
13//#include <zypp-core/base/Logger.h>
14
15#include <zypp/base/SerialNumber.h>
16
17using std::endl;
18
20namespace zypp
21{
22
24 //
25 // CLASS NAME : SerialNumber
26 //
28
30 //
31 // METHOD NAME : SerialNumber::SerialNumber
32 // METHOD TYPE : Ctor
33 //
34 SerialNumber::SerialNumber( bool dirty_r )
35 : _dirty( dirty_r )
36 , _serial( 0 )
37 {}
38
40 //
41 // METHOD NAME : SerialNumber::~SerialNumber
42 // METHOD TYPE : Dtor
43 //
44 SerialNumber::~SerialNumber()
45 {}
46
47 /******************************************************************
48 **
49 ** FUNCTION NAME : operator<<
50 ** FUNCTION TYPE : std::ostream &
51 */
52 std::ostream & operator<<( std::ostream & str, const SerialNumber & obj )
53 {
54 return str << "SERIAL" << (obj._dirty?"*":"(") << obj._serial << (obj._dirty?"*":")");
55 }
56
58 //
59 // CLASS NAME : SerialNumberWatcher
60 //
62
64 //
65 // METHOD NAME : SerialNumberWatcher::SerialNumberWatcher
66 // METHOD TYPE : Ctor
67 //
68 SerialNumberWatcher::SerialNumberWatcher( unsigned serial_r )
69 : _serial( serial_r )
70 {}
71
73 //
74 // METHOD NAME : SerialNumberWatcher::SerialNumberWatcher
75 // METHOD TYPE : Ctor
76 //
77 SerialNumberWatcher::SerialNumberWatcher( const SerialNumber & serial_r )
78 : _serial( serial_r.serial() )
79 {}
80
82 //
83 // METHOD NAME : SerialNumber::~SerialNumber
84 // METHOD TYPE : Dtor
85 //
86 SerialNumberWatcher::~SerialNumberWatcher()
87 {}
88
89 /******************************************************************
90 **
91 ** FUNCTION NAME : operator<<
92 ** FUNCTION TYPE : std::ostream &
93 */
94 std::ostream & operator<<( std::ostream & str, const SerialNumberWatcher & obj )
95 {
96 return str << "LAST_SERIAL(" << obj._serial << ")";
97 }
98
100} // namespace zypp
SerialNumber.h
zypp::SerialNumberWatcher::_serial
unsigned _serial
Definition SerialNumber.h:174
zypp::SerialNumberWatcher::SerialNumberWatcher
SerialNumberWatcher(unsigned serial_r=(unsigned) -1)
Ctor taking an initial serial value.
Definition SerialNumber.cc:68
zypp::SerialNumberWatcher::~SerialNumberWatcher
virtual ~SerialNumberWatcher()
Dtor.
Definition SerialNumber.cc:86
zypp::SerialNumber
Simple serial number provider.
Definition SerialNumber.h:45
zypp::SerialNumber::~SerialNumber
virtual ~SerialNumber()
Dtor.
Definition SerialNumber.cc:44
zypp::SerialNumber::SerialNumber
SerialNumber(bool dirty_r=false)
Ctor taking initial dirty value.
Definition SerialNumber.cc:34
zypp::SerialNumber::_dirty
bool _dirty
Definition SerialNumber.h:76
zypp::SerialNumber::_serial
unsigned _serial
Definition SerialNumber.h:77
str
String related utilities and Regular expression matching.
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::operator<<
std::ostream & operator<<(std::ostream &str, const Capabilities &obj)
relates: Capabilities Stream output
Definition Capabilities.cc:65