- include original C header files
authorArvin Schnell <aschnell@suse.de>
Tue, 25 Sep 2007 16:31:06 +0000 (16:31 +0000)
committerArvin Schnell <aschnell@suse.de>
Tue, 25 Sep 2007 16:31:06 +0000 (16:31 +0000)
swig/KeyRing.i
swig/Pathname.i
swig/PublicKey.i
swig/RepoInfo.i
swig/RepoManager.i
swig/Target.i
swig/TmpPath.i
swig/perl5/perl.i
swig/python/python.i
swig/ruby/ruby.i
swig/zypp.i

index 318aa0b..b57eb4e 100644 (file)
@@ -6,7 +6,7 @@ class KeyRing
 
 public:
 
-    KeyRing(const Pathname& baseTmpDir);
+    KeyRing(const zypp::Pathname& baseTmpDir);
     ~KeyRing();
 
     void importKey(const PublicKey& key, bool trusted = false);
index 67bd58c..afdf52b 100644 (file)
@@ -1,42 +1,4 @@
 
-class Pathname
-{
-public:
-
-    Pathname();
-    Pathname(const std::string&);
-    Pathname(const char*);
-
-    const std::string & asString() const;
-
-    bool empty() const;
-    bool absolute() const;
-    bool relative() const;
-
-};
-
-
-// #ifdef SWIGRUBY
-//
-// // Something like 'opts.repoCachePath = tmp_cache_path.path()' causes out and
-// // in transformation. Can that be avoided?
-//
-// %typemap(in) const Pathname&, Pathname* {
-//     VALUE pathstring = rb_funcall( $input, rb_intern("to_s"), 0, 0);
-//     Pathname *p = new Pathname( (RSTRING(pathstring)->ptr) );
-//     $1 = p;
-// }
-//
-// %typemap(freearg) const Pathname&, Pathname* {
-//     delete $1;
-// }
-//
-// %typemap(out) Pathname {
-//     rb_require("pathname");
-//     VALUE klass = rb_const_get( rb_cObject, rb_intern("Pathname"));
-//     VALUE rbpathstr = rb_str_new2($1.asString().c_str());
-//     $result = rb_funcall( klass, rb_intern("new"), 1, rbpathstr);
-// }
-//
-// #endif
+// TODO: tell make about dependencies
+%include <zypp/Pathname.h>
 
index a219661..d908f05 100644 (file)
@@ -5,7 +5,7 @@ class PublicKey
 public:
 
     PublicKey();
-    PublicKey(const Pathname& file);
+    PublicKey(const zypp::Pathname& file);
     ~PublicKey();
 
     bool isValid() const;
@@ -15,7 +15,7 @@ public:
     std::string id() const;
     std::string name() const;
     std::string fingerprint() const;
-    Pathname path() const;
+    zypp::Pathname path() const;
 
 };
 
index 7456431..5d6d22f 100644 (file)
@@ -71,7 +71,7 @@ public:
      * \note could be an empty pathname for repo
      * infos created in memory.
      */
-     Pathname filepath() const;
+     zypp::Pathname filepath() const;
 
     /**
      * Add a base url. \see baseUrls
@@ -121,7 +121,7 @@ public:
      * \short set the repository filepath
      * \param path File path
      */
-    RepoInfo & setFilepath( const Pathname &filename );
+    RepoInfo & setFilepath( const zypp::Pathname &filename );
 
     std::ostream & dumpOn( std::ostream & str ) const;
 
index 9738af2..51061e7 100644 (file)
@@ -1,13 +1,13 @@
-   
+
   std::list<RepoInfo> readRepoFile(const Url & repo_file);
 
   struct RepoManagerOptions
   {
     RepoManagerOptions();
-    
-    Pathname repoCachePath;
-    Pathname repoRawCachePath;
-    Pathname knownReposPath;
+
+    zypp::Pathname repoCachePath;
+    zypp::Pathname repoRawCachePath;
+    zypp::Pathname knownReposPath;
   };
 
   class RepoManager
   public:
    RepoManager( const RepoManagerOptions &options = RepoManagerOptions() );
     ~RepoManager();
-    
+
     enum RawMetadataRefreshPolicy
     {
       RefreshIfNeeded,
       RefreshForced
     };
-    
+
     enum CacheBuildPolicy
     {
       BuildIfNeeded,
       BuildForced
     };
-    
+
     enum RepoRemovePolicy
     {
-      
+
     };
-    
+
    std::list<RepoInfo> knownRepositories() const;
  void refreshMetadata( const RepoInfo &info,
                          RawMetadataRefreshPolicy policy = RefreshIfNeeded,
@@ -53,5 +53,5 @@
                          const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
     void removeRepository( const RepoInfo & info,
                            const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
-    
+
   };
index dfa66eb..bbff4e6 100644 (file)
@@ -44,14 +44,14 @@ class Target
 #ifndef STORAGE_DISABLED
     /** enables the storage target */
     bool isStorageEnabled() const;
-    void enableStorage(const Pathname &root_r);
+    void enableStorage(const zypp::Pathname &root_r);
 #endif
 
     /** Set the log file for target */
-    bool setInstallationLogfile(const Pathname & path_r);
+    bool setInstallationLogfile(const zypp::Pathname & path_r);
 
     /** Return the root set for this target */
-    Pathname root() const;
+    zypp::Pathname root() const;
 
     /** return the last modification date of the target */
     Date timestamp() const;
index bed2349..d8b2ea8 100644 (file)
@@ -1,45 +1,4 @@
 
-class TmpPath
-{
-public:
-
-    TmpPath();
-
-    explicit TmpPath( const Pathname & tmpPath_r );
-
-    virtual ~TmpPath();
-
-    Pathname path() const;
-
-    static const Pathname & defaultLocation();
-
-};
-
-
-class TmpFile : public TmpPath
-{
-public:
-
-    explicit TmpFile( const Pathname & inParentDir_r = defaultLocation(),
-                     const std::string & prefix_r = defaultPrefix() );
-
-    static TmpFile makeSibling( const Pathname & sibling_r );
-
-    static const std::string & defaultPrefix();
-
-};
-
-
-class TmpDir : public TmpPath
-{
-public:
-
-    explicit TmpDir( const Pathname & inParentDir_r = defaultLocation(),
-                    const std::string & prefix_r = defaultPrefix() );
-
-    static TmpDir makeSibling( const Pathname & sibling_r );
-
-    static const std::string & defaultPrefix();
-
-};
+// TODO: tell make about dependencies
+%include <zypp/TmpPath.h>
 
index b5f150a..58edcc7 100644 (file)
@@ -1,3 +1,13 @@
+
+namespace zypp
+{
+    // These operators must be ignored otherwise the wrapper does
+    // not compile (using swig 1.3.29).
+    %ignore operator<<;
+    %ignore operator==;
+    %ignore operator!=;
+}
+
 %define iter(cls, storetype)
 %extend cls {
    cls::const_iterator iterator_incr(cls::const_iterator *it){
index 3102cf7..522adea 100644 (file)
@@ -5,6 +5,11 @@
 
 namespace zypp
 {
+    // These operators must be ignored otherwise the wrapper does
+    // not compile (using swig 1.3.29).
+    %ignore operator==;
+    %ignore operator!=;
+
     // Just to avoid warnings.
     %ignore operator<<;
 }
index 36b1ec1..1f7c10c 100644 (file)
@@ -13,6 +13,14 @@ namespace zypp
     // Just to avoid warnings.
     %ignore operator!=;
     %ignore operator<<;
+
+    namespace filesystem
+    {
+       // Same as above.
+       %ignore operator==;
+       %ignore operator!=;
+       %ignore operator<<;
+    }
 }
 
 
index 9cae74c..5a1e40c 100644 (file)
@@ -144,7 +144,7 @@ class ZYpp
     void setPartitions(const DiskUsageCounter::MountPointSet &mp);
     */
     Target_Ptr target() const;
-    void initializeTarget(const Pathname & root);
+    void initializeTarget(const zypp::Pathname & root);
     void finishTarget();
 
     typedef ZYppCommitResult CommitResult;
@@ -162,9 +162,9 @@ class ZYpp
     LocaleSet getAvailableLocales() const;
     void availableLocale( const Locale & locale_r );
     */
-    Pathname homePath() const;
-    Pathname tmpPath() const;
-    void setHomePath( const Pathname & path );
+    zypp::Pathname homePath() const;
+    zypp::Pathname tmpPath() const;
+    void setHomePath( const zypp::Pathname & path );
 
     Arch architecture() const;
     void setArchitecture( const Arch & arch );