added dumpOn
authorStefan Schubert <schubi@suse.de>
Thu, 2 Feb 2006 15:37:37 +0000 (15:37 +0000)
committerStefan Schubert <schubi@suse.de>
Thu, 2 Feb 2006 15:37:37 +0000 (15:37 +0000)
zypp/ProblemSolution.cc
zypp/solver/detail/Resolver_problems.cc
zypp/solver/detail/SolutionAction.cc
zypp/solver/detail/SolutionAction.h

index 9726b83f1cb480579cfb8f033e6d052ea190a7b8..cc741f3c169bcdd078bc1e2d03b41e7a1b9c03ff 100644 (file)
@@ -51,7 +51,7 @@ ostream&
 operator<<( ostream& os, const ProblemSolutionList & solutionlist)
 {
     for (ProblemSolutionList::const_iterator iter = solutionlist.begin(); iter != solutionlist.end(); ++iter) {
-       os << (*iter) << endl;
+       os << *(*iter) << endl;
     }
     return os;
 }
@@ -60,7 +60,7 @@ ostream&
 operator<<( ostream& os, const CProblemSolutionList & solutionlist)
 {
     for (CProblemSolutionList::const_iterator iter = solutionlist.begin(); iter != solutionlist.end(); ++iter) {
-       os << (*iter) << endl;
+       os << *(*iter) << endl;
     }
     return os;
 }
index 663aa230eb5b2af7bd7997dd344aac5a0302f505..f7ea4aea6fbfe2a1bc5fb3895762b7758abf98b4 100644 (file)
@@ -390,6 +390,7 @@ Resolver::problems (void) const
                // Uninstall p
                problem->addSolution (new ProblemSolutionUninstall (problem, item));
                // Remove conflict in the resolvable which has to be installed
+               
                problem->addSolution (new ProblemSolutionIgnore (problem, Dep::CONFLICTS, item, misc_info->capability(),
                                                                 misc_info->other())); 
                problems.push_back (problem);
index 25a7222c2928a890422d3fc373b2c8d96fce9bea..67625229ff75b3d737c8e25ae48a25c3c2c0c118 100644 (file)
@@ -58,11 +58,11 @@ SolutionAction::~SolutionAction()
 
 //---------------------------------------------------------------------------
 
-ostream&
-operator<<( ostream& os, const TransactionSolutionAction & action)
+ostream &
+TransactionSolutionAction::dumpOn( ostream& os) const
 {
     os << "TransactionSolutionAction: ";
-    switch (action._action) {
+    switch (_action) {
        case KEEP:      os << "Keep"; break;
        case INSTALL:   os << "Install"; break;
        case UPDATE:    os << "Update"; break;
@@ -70,7 +70,7 @@ operator<<( ostream& os, const TransactionSolutionAction & action)
        case UNLOCK:    os << "Unlock"; break;      
     }
     os << " ";
-    os << action._item;
+    os << _item;
     os << endl;
     return os;
 }
@@ -80,7 +80,7 @@ ostream&
 operator<<( ostream& os, const SolutionActionList & actionlist)
 {
     for (SolutionActionList::const_iterator iter = actionlist.begin(); iter != actionlist.end(); ++iter) {
-       os << (*iter);
+       os << *(*iter);
        os << endl;
     }
     return os;
@@ -91,7 +91,7 @@ ostream&
 operator<<( ostream& os, const CSolutionActionList & actionlist)
 {
     for (CSolutionActionList::const_iterator iter = actionlist.begin(); iter != actionlist.end(); ++iter) {
-       os << (*iter);
+       os << *(*iter);
        os << endl;
     }
     return os;
@@ -99,13 +99,13 @@ operator<<( ostream& os, const CSolutionActionList & actionlist)
 
 //---------------------------------------------------------------------------
 
-ostream&
-operator<<( ostream& os, const InjectSolutionAction & action)
+ostream &
+InjectSolutionAction::dumpOn( ostream& os ) const
 {
     os << "InjectSolutionAction: ";
-    os << action._capability;
+    os << _capability;
     os << ", ";
-    os << action._kind;
+    os << _kind;
     os << endl;
     return os;
 }
@@ -113,6 +113,16 @@ operator<<( ostream& os, const InjectSolutionAction & action)
 //---------------------------------------------------------------------------
 
 
+ostream &
+SolutionAction::dumpOn( std::ostream & os ) const
+{
+    os << "SolutionAction<";
+    os << "not specified";
+    os << "> ";
+    return os;
+}
+
+
 bool 
 TransactionSolutionAction::execute(Resolver & resolver) const
 {
index bdc2f8f49ca5c99bfaa1f35217cf1981982802d9..9adcfac20e3d15a4a400ce5faaca810c21fa7895 100644 (file)
@@ -42,10 +42,11 @@ namespace zypp
            virtual ~SolutionAction();
 
            // ---------------------------------- I/O
-
-           friend std::ostream& operator<<(std::ostream&, const SolutionAction & action);
-           friend std::ostream& operator<<(std::ostream&, const SolutionActionList & actionlist);
-           friend std::ostream& operator<<(std::ostream&, const CSolutionActionList & actionlist);
+           virtual std::ostream & dumpOn( std::ostream & str ) const;
+           friend std::ostream& operator<<(std::ostream & str, const SolutionAction & action)
+               { return action.dumpOn (str); }
+           friend std::ostream& operator<<(std::ostream & str, const SolutionActionList & actionlist);
+           friend std::ostream& operator<<(std::ostream & str, const CSolutionActionList & actionlist);
 
            // ---------------------------------- methods
            /**
@@ -79,8 +80,9 @@ namespace zypp
                  _item( item ), _action( action ) {}
 
          // ---------------------------------- I/O
-
-         friend std::ostream& operator<<(std::ostream&, const TransactionSolutionAction & action);
+         virtual std::ostream & dumpOn( std::ostream & str ) const;
+         friend std::ostream& operator<<(std::ostream& str, const TransactionSolutionAction & action)
+               { return action.dumpOn (str); }
 
          // ---------------------------------- accessors
 
@@ -123,8 +125,9 @@ namespace zypp
                  _capability( capability ), _kind( kind ), _otherItem( otherItem ) {}
 
          // ---------------------------------- I/O
-
-         friend std::ostream& operator<<(std::ostream&, const InjectSolutionAction & action);
+         virtual std::ostream & dumpOn( std::ostream & str ) const;
+         friend std::ostream& operator<<(std::ostream& str, const InjectSolutionAction & action)
+               { return action.dumpOn (str); }       
 
          // ---------------------------------- accessors
            const Capability & capability() const { return _capability; };
@@ -135,8 +138,8 @@ namespace zypp
 
        protected:
 
-           const Capability _capability;
-           const Dep _kind;
+           const Capability _capability;
+           const Dep _kind;
            PoolItem_Ref _item, _otherItem;         
        };