From 0ef6ae12751142c9fa7de8a85a9f1e6c5ca926db Mon Sep 17 00:00:00 2001 From: Arvin Schnell Date: Tue, 25 Sep 2007 16:31:06 +0000 Subject: [PATCH] - include original C header files --- swig/KeyRing.i | 2 +- swig/Pathname.i | 42 ++---------------------------------------- swig/PublicKey.i | 4 ++-- swig/RepoInfo.i | 4 ++-- swig/RepoManager.i | 22 +++++++++++----------- swig/Target.i | 6 +++--- swig/TmpPath.i | 45 ++------------------------------------------- swig/perl5/perl.i | 10 ++++++++++ swig/python/python.i | 5 +++++ swig/ruby/ruby.i | 8 ++++++++ swig/zypp.i | 8 ++++---- 11 files changed, 50 insertions(+), 106 deletions(-) diff --git a/swig/KeyRing.i b/swig/KeyRing.i index 318aa0b..b57eb4e 100644 --- a/swig/KeyRing.i +++ b/swig/KeyRing.i @@ -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); diff --git a/swig/Pathname.i b/swig/Pathname.i index 67bd58c..afdf52b 100644 --- a/swig/Pathname.i +++ b/swig/Pathname.i @@ -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 diff --git a/swig/PublicKey.i b/swig/PublicKey.i index a219661..d908f05 100644 --- a/swig/PublicKey.i +++ b/swig/PublicKey.i @@ -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; }; diff --git a/swig/RepoInfo.i b/swig/RepoInfo.i index 7456431..5d6d22f 100644 --- a/swig/RepoInfo.i +++ b/swig/RepoInfo.i @@ -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; diff --git a/swig/RepoManager.i b/swig/RepoManager.i index 9738af2..51061e7 100644 --- a/swig/RepoManager.i +++ b/swig/RepoManager.i @@ -1,13 +1,13 @@ - + std::list 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 @@ -15,24 +15,24 @@ public: RepoManager( const RepoManagerOptions &options = RepoManagerOptions() ); ~RepoManager(); - + enum RawMetadataRefreshPolicy { RefreshIfNeeded, RefreshForced }; - + enum CacheBuildPolicy { BuildIfNeeded, BuildForced }; - + enum RepoRemovePolicy { - + }; - + std::list 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() ); - + }; diff --git a/swig/Target.i b/swig/Target.i index dfa66eb..bbff4e6 100644 --- a/swig/Target.i +++ b/swig/Target.i @@ -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; diff --git a/swig/TmpPath.i b/swig/TmpPath.i index bed2349..d8b2ea8 100644 --- a/swig/TmpPath.i +++ b/swig/TmpPath.i @@ -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 diff --git a/swig/perl5/perl.i b/swig/perl5/perl.i index b5f150a..58edcc7 100644 --- a/swig/perl5/perl.i +++ b/swig/perl5/perl.i @@ -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){ diff --git a/swig/python/python.i b/swig/python/python.i index 3102cf7..522adea 100644 --- a/swig/python/python.i +++ b/swig/python/python.i @@ -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<<; } diff --git a/swig/ruby/ruby.i b/swig/ruby/ruby.i index 36b1ec1..1f7c10c 100644 --- a/swig/ruby/ruby.i +++ b/swig/ruby/ruby.i @@ -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<<; + } } diff --git a/swig/zypp.i b/swig/zypp.i index 9cae74c..5a1e40c 100644 --- a/swig/zypp.i +++ b/swig/zypp.i @@ -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 ); -- 2.7.4