some cleanup for swig
authorMichael Andres <ma@suse.de>
Mon, 21 Jul 2008 14:22:01 +0000 (14:22 +0000)
committerMichael Andres <ma@suse.de>
Mon, 21 Jul 2008 14:22:01 +0000 (14:22 +0000)
zypp/Capability.cc
zypp/Capability.h
zypp/IdString.h
zypp/RepoManager.h
zypp/ResStatus.cc
zypp/ResStatus.h
zypp/Resolvable.h
zypp/ZYppCommitPolicy.h
zypp/sat/Solvable.h

index a48f0b3..ba4f17c 100644 (file)
@@ -155,6 +155,7 @@ namespace zypp
   ///////////////////////////////////////////////////////////////////
 
   const Capability Capability::Null( STRID_NULL );
+  const Capability Capability::Empty( STRID_EMPTY );
 
   /////////////////////////////////////////////////////////////////
 
index 6a6bf31..b9f5fca 100644 (file)
@@ -123,9 +123,10 @@ namespace zypp
       static const Capability Empty;
 
     public:
+#ifndef SWIG // Swig treats it as syntax error
       /** Evaluate in a boolean context <tt>( ! empty() )</tt>. */
       using base::SafeBool<Capability>::operator bool_type;
-
+#endif
       /** Whether the \ref Capability is empty.
        * This is true for \ref Null and \ref Empty.
        */
@@ -207,7 +208,9 @@ namespace zypp
       /** Match two Capabilities */
       static CapMatch _doMatch( sat::detail::IdType lhs,  sat::detail::IdType rhs );
     private:
+#ifndef SWIG // Swig treats it as syntax error
       friend base::SafeBool<Capability>::operator bool_type() const;
+#endif
       bool boolTest() const { return ! empty(); }
     private:
       sat::detail::IdType _id;
@@ -336,6 +339,6 @@ namespace zypp
 } // namespace zypp
 ///////////////////////////////////////////////////////////////////
 
-ZYPP_DEFINE_ID_HASHABLE( ::zypp::Capability )
+ZYPP_DEFINE_ID_HASHABLE( ::zypp::Capability );
 
 #endif // ZYPP_CAPABILITY_H
index a43fc71..cfac604 100644 (file)
@@ -215,6 +215,6 @@ namespace zypp
 } // namespace zypp
 ///////////////////////////////////////////////////////////////////
 
-ZYPP_DEFINE_ID_HASHABLE( ::zypp::IdString )
+ZYPP_DEFINE_ID_HASHABLE( ::zypp::IdString );
 
 #endif // ZYPP_SAT_IDSTR_H
index d004d2b..4dc61bc 100644 (file)
@@ -457,7 +457,7 @@ namespace zypp
     /**
      * Adds new service
      *
-     * \param name service info 
+     * \param name service info
      *
      * \throws FIXME RepoAlreadyExistException and as reponame is service name
      */
@@ -515,7 +515,7 @@ namespace zypp
     void refreshServices();
 
     /**
-     * Refresh specific service. 
+     * Refresh specific service.
      * \throws Exception if cannot download file
      * \param name service structure
      */
@@ -524,7 +524,7 @@ namespace zypp
     /**
      * modify service, rewrite Service to filesystem.
      * If change Service name, then can escalate to rewrite all repositories which it contain.
-     * 
+     *
      * \param oldName oldName of service
      * \param service Structure containing new datas
      *
@@ -533,6 +533,7 @@ namespace zypp
      */
     void modifyService(const std::string& oldName, const Service& service);
 
+    private:
     /**
      * Functor thats filter RepoInfo by service which belongs to.
      */
@@ -544,6 +545,7 @@ namespace zypp
         bool match( const RepoInfo& info ) { return info.service()==name; }
     };
 
+    public:
     /**
      * fill to output iterator repositories in service name. This output iterator can perform
      * any action on with Repo or service Container, because it is sets and it isn't dynamic recreate.
@@ -565,14 +567,14 @@ namespace zypp
      * ChangePriority changer(10);
      * getRepositoriesInService(name,getRepositoriesInService( name, boost::make_function_output_iterator(bind(&ChangePriority::doIt, &changer, _1))));
      * \endcode
-     */ 
+     */
 
     template<typename OutputIterator>
     void getRepositoriesInService( const std::string& name, OutputIterator out ) const
     {
       MatchServiceName filter(name);
 
-      std::copy(boost::make_filter_iterator(bind(&MatchServiceName::match, 
+      std::copy(boost::make_filter_iterator(bind(&MatchServiceName::match,
           filter, _1),repoBegin(),repoEnd()), boost::make_filter_iterator(
           bind(&MatchServiceName::match, filter, _1),repoEnd(),repoEnd()),
           out );
index 5722915..482d766 100644 (file)
@@ -21,13 +21,8 @@ namespace zypp
 { /////////////////////////////////////////////////////////////////
 
   const ResStatus ResStatus::toBeInstalled              (UNINSTALLED, UNDETERMINED, TRANSACT);
-  const ResStatus ResStatus::toBeInstalledSoft          (UNINSTALLED, UNDETERMINED, TRANSACT, SOFT_INSTALL);
   const ResStatus ResStatus::toBeUninstalled            (INSTALLED,   UNDETERMINED, TRANSACT);
-  const ResStatus ResStatus::toBeUninstalledSoft        (INSTALLED,   UNDETERMINED, TRANSACT, EXPLICIT_INSTALL, SOFT_REMOVE);
-  const ResStatus ResStatus::toBeUninstalledDueToObsolete(INSTALLED,   UNDETERMINED, TRANSACT, EXPLICIT_INSTALL, DUE_TO_OBSOLETE);
   const ResStatus ResStatus::toBeUninstalledDueToUpgrade (INSTALLED,   UNDETERMINED, TRANSACT, EXPLICIT_INSTALL, DUE_TO_UPGRADE);
-  const ResStatus ResStatus::installed                  (INSTALLED);
-  const ResStatus ResStatus::uninstalled                (UNINSTALLED);
 
   ///////////////////////////////////////////////////////////////////
   //
index a35aeb5..cd078f7 100644 (file)
@@ -420,7 +420,7 @@ namespace zypp
       {
           fieldValueAssign<TransactField>( KEEP_STATE );
       }
-      fieldValueAssign<TransactDetailField>( NO_DETAIL ); // Details has to be set again     
+      fieldValueAssign<TransactDetailField>( NO_DETAIL ); // Details has to be set again
       fieldValueAssign<TransactByField>( causer_r );
       return true;
     }
@@ -633,21 +633,8 @@ namespace zypp
     /** \name Builtin ResStatus constants. */
     //@{
     static const ResStatus toBeInstalled;
-    static const ResStatus toBeInstalledSoft;
     static const ResStatus toBeUninstalled;
-    static const ResStatus toBeUninstalledSoft;
-    static const ResStatus toBeUninstalledDueToUnlink;
-    static const ResStatus toBeUninstalledDueToObsolete;
     static const ResStatus toBeUninstalledDueToUpgrade;
-    static const ResStatus installed;  // installed, status after successful target 'install' commit
-    static const ResStatus uninstalled;        // uninstalled, status after successful target 'uninstall' commit
-    static const ResStatus satisfied;  // uninstalled, satisfied
-    static const ResStatus complete;   // installed, satisfied
-    static const ResStatus unneeded;   // uninstalled, unneeded
-    static const ResStatus needed;     // uninstalled, incomplete
-    static const ResStatus incomplete; // installed, incomplete
-    static const ResStatus recommended;        // recommended
-    static const ResStatus suggested;  // suggested
     //@}
 
   private:
index e906a33..5ca069b 100644 (file)
@@ -49,8 +49,10 @@ namespace zypp
     typedef TraitsType::constPtrType constPtr;
 
   public:
+#ifndef SWIG // Swig treats it as syntax error
     /** Whether this represents a valid- or no-solvable. */
     using sat::Solvable::operator bool_type;
+#endif
     /** Whether this represents an installed solvable. */
     using sat::Solvable::isSystem;
 
index d6d5c90..52b47a1 100644 (file)
@@ -60,15 +60,15 @@ namespace zypp
     { return restrictToMedia( 0 ); }
 
     /** Set dry run (default: false) */
-    ZYppCommitPolicy & dryRun( bool yesNo_r = true )
+    ZYppCommitPolicy & dryRun( bool yesNo_r )
     { _dryRun = yesNo_r; return *this; }
 
     /** Use rpm option --nosignature (default: false) */
-    ZYppCommitPolicy & rpmNoSignature( bool yesNo_r = true )
+    ZYppCommitPolicy & rpmNoSignature( bool yesNo_r )
     { _rpmNoSignature = yesNo_r; return *this; }
 
     /** Kepp pool in sync with the Target databases after commit (default: true) */
-    ZYppCommitPolicy & syncPoolAfterCommit( bool yesNo_r = true )
+    ZYppCommitPolicy & syncPoolAfterCommit( bool yesNo_r )
     { _syncPoolAfterCommit = yesNo_r; return *this; }
 
   private:
index e47ac60..c422a58 100644 (file)
@@ -73,8 +73,10 @@ namespace zypp
         /** Represents no \ref Solvable. */
         static const Solvable noSolvable;
 
+#ifndef SWIG // Swig treats it as syntax error
         /** Evaluate \ref Solvable in a boolean context (\c != \c noSolvable). */
         using base::SafeBool<Solvable>::operator bool_type;
+#endif
 
         /** Return whether this \ref Solvable belongs to the system repo.
          * \note This includes the otherwise hidden systemSolvable.
@@ -231,7 +233,9 @@ namespace zypp
         /** Expert backdoor. */
         IdType id() const { return _id; }
       private:
+#ifndef SWIG // Swig treats it as syntax error
         friend base::SafeBool<Solvable>::operator bool_type() const;
+#endif
         bool boolTest() const { return get(); }
       private:
         IdType _id;
@@ -318,6 +322,6 @@ namespace zypp
 } // namespace zypp
 ///////////////////////////////////////////////////////////////////
 
-ZYPP_DEFINE_ID_HASHABLE( ::zypp::sat::Solvable )
+ZYPP_DEFINE_ID_HASHABLE( ::zypp::sat::Solvable );
 
 #endif // ZYPP_SAT_SOLVABLE_H