libzypp: zypp/sat/FileConflicts.h Source File

libzypp 17.38.14

FileConflicts.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
11#ifndef ZYPP_SAT_FILECONFLICTS_H
12#define ZYPP_SAT_FILECONFLICTS_H
13
14#include <iosfwd>
15
16#include <zypp-core/base/PtrTypes.h>
17#include <zypp/sat/Queue.h>
18#include <zypp/sat/Solvable.h>
19
21namespace zypp
22{
24 namespace sat
25 {
30 class ZYPP_API FileConflicts : private Queue
31 {
32 friend bool operator==( const FileConflicts & lhs, const FileConflicts & rhs );
33 static constexpr size_type queueBlockSize = 6;
34
35 public:
40 struct Conflict
41 {
42 IdString lhsFilename() const { return IdString( _data[0] ); }
43 Solvable lhsSolvable() const { return Solvable( _data[1] ); }
44 IdString lhsFilemd5() const { return IdString( _data[2] ); }
45
46 IdString rhsFilename() const { return IdString( _data[3] ); }
47 Solvable rhsSolvable() const { return Solvable( _data[4] ); }
48 IdString rhsFilemd5() const { return IdString( _data[5] ); }
49
51 std::string asUserString() const;
52
53 private:
54 detail::IdType _data[queueBlockSize];
55 };
56
57 public:
58 using Queue::size_type;
59 using value_type = Conflict;
60 using const_iterator = const value_type *;
61
62 using Queue::empty;
63 size_type size() const { return Queue::size()/queueBlockSize; }
64 const_iterator begin() const { return reinterpret_cast<const_iterator>(Queue::begin()); }
65 const_iterator end() const { return reinterpret_cast<const_iterator>(Queue::end()); }
66
67 public:
68 using Queue::operator detail::CQueue *;
69 using Queue::operator const detail::CQueue *;
70 };
71
73 std::ostream & operator<<( std::ostream & str, const FileConflicts & obj ) ZYPP_API;
74
76 std::ostream & operator<<( std::ostream & str, const FileConflicts::Conflict & obj ) ZYPP_API;
77
79 std::ostream & dumpAsXmlOn( std::ostream & str, const FileConflicts & obj ) ZYPP_API;
80
82 std::ostream & dumpAsXmlOn( std::ostream & str, const FileConflicts::Conflict & obj ) ZYPP_API;
83
85 inline bool operator==( const FileConflicts & lhs, const FileConflicts & rhs )
86 { return static_cast<const Queue &>(lhs) == static_cast<const Queue &>(rhs); }
87
89 inline bool operator!=( const FileConflicts & lhs, const FileConflicts & rhs )
90 { return !( lhs == rhs ); }
91
92 } // namespace sat
94} // namespace zypp
96#endif // ZYPP_SAT_FILECONFLICTS_H
PtrTypes.h
Queue.h
Solvable.h
zypp::IdString
Access to the sat-pools string space.
Definition IdString.h:55
zypp::sat::FileConflicts
Libsolv queue representing file conflicts.
Definition FileConflicts.h:31
zypp::sat::FileConflicts::value_type
Conflict value_type
Definition FileConflicts.h:59
zypp::sat::FileConflicts::size_type
unsigned int size_type
Definition Queue.h:38
zypp::sat::FileConflicts::const_iterator
const value_type * const_iterator
Definition FileConflicts.h:60
zypp::sat::FileConflicts::begin
const_iterator begin() const
Definition FileConflicts.h:64
zypp::sat::FileConflicts::queueBlockSize
static constexpr size_type queueBlockSize
Definition FileConflicts.h:33
zypp::sat::FileConflicts::end
const_iterator end() const
Definition FileConflicts.h:65
zypp::sat::FileConflicts::size
size_type size() const
Definition FileConflicts.h:63
zypp::sat::FileConflicts::operator==
friend bool operator==(const FileConflicts &lhs, const FileConflicts &rhs)
relates: FileConflicts
Definition FileConflicts.h:85
zypp::sat::Queue::size_type
unsigned int size_type
Definition Queue.h:38
zypp::sat::Queue::size
size_type size() const
Definition Queue.cc:49
zypp::sat::Queue::end
const_iterator end() const
Definition Queue.cc:55
zypp::sat::Queue::Queue
Queue()
Default ctor: empty Queue.
Definition Queue.cc:39
zypp::sat::Queue::begin
const_iterator begin() const
Definition Queue.cc:52
zypp::sat::Queue::empty
bool empty() const
Definition Queue.cc:46
zypp::sat::Solvable
A Solvable object within the sat Pool.
Definition Solvable.h:54
str
String related utilities and Regular expression matching.
zypp::sat::detail::IdType
int IdType
Generic Id type.
Definition PoolDefines.h:42
zypp::sat::detail::CQueue
::s_Queue CQueue
Wrapped libsolv C data type exposed as backdoor.
Definition PoolDefines.h:35
zypp::sat
Libsolv interface
zypp::sat::dumpAsXmlOn
std::ostream & dumpAsXmlOn(std::ostream &str, const FileConflicts &obj)
relates: FileConflicts XML output
Definition FileConflicts.cc:132
zypp::sat::operator<<
std::ostream & operator<<(std::ostream &str, const FileConflicts &obj)
relates: FileConflicts Stream output
Definition FileConflicts.cc:109
zypp::sat::operator!=
bool operator!=(const FileConflicts &lhs, const FileConflicts &rhs)
relates: FileConflicts
Definition FileConflicts.h:89
zypp::sat::operator==
bool operator==(const FileConflicts &lhs, const FileConflicts &rhs)
relates: FileConflicts
Definition FileConflicts.h:85
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::asUserString
std::string asUserString(VendorSupportOption opt)
converts the support option to a name intended to be printed to the user.
Definition VendorSupportOptions.cc:9
zypp::ZYPP_API
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Definition Arch.h:173
zypp::sat::FileConflicts::Conflict
A file conflict.
Definition FileConflicts.h:41
zypp::sat::FileConflicts::Conflict::lhsFilename
IdString lhsFilename() const
Definition FileConflicts.h:42
zypp::sat::FileConflicts::Conflict::lhsFilemd5
IdString lhsFilemd5() const
Definition FileConflicts.h:44
zypp::sat::FileConflicts::Conflict::rhsFilename
IdString rhsFilename() const
Definition FileConflicts.h:46
zypp::sat::FileConflicts::Conflict::lhsSolvable
Solvable lhsSolvable() const
Definition FileConflicts.h:43
zypp::sat::FileConflicts::Conflict::_data
detail::IdType _data[queueBlockSize]
Definition FileConflicts.h:54
zypp::sat::FileConflicts::Conflict::rhsFilemd5
IdString rhsFilemd5() const
Definition FileConflicts.h:48
zypp::sat::FileConflicts::Conflict::rhsSolvable
Solvable rhsSolvable() const
Definition FileConflicts.h:47