Attempt to create generated bindings for
libzypp. Not restricted to one language.
-Author: dmacvicar@suse.de
-
-Notes:
-
-- Some classes are not wrapped but converted to
- equivalents:
-
-Usage:
-
-Requires swig and ruby installed.
+Authors: dmacvicar@suse.de
+ aschnell@suse.de
Ruby Notes
==========
* API tries to follow ruby standards:
-* zypp::Pathname -> std Pathname in ruby
-* zypp::Date -> std Time in ruby
-* ResStore does not implement iterators but:
+* Containers do not implement iterators but:
* each
- * each_by_name
+ * to_a
* etc
* lower case methods, ie: ZYppFactory::instance.get_zypp
instead of ZYppFactory::instance()->getZYpp()
z.initialize_target("/") for z.initializeTarget("/")
+
-#ifdef SWIGRUBY
+#if defined(SWIGPYTHON) || defined(SWIGRUBY)
+%rename Date::asString "__str__";
+#endif
-%typemap(in) Date {
- Date::ValueType seconds = (Date::ValueType) NUM2INT( rb_funcall( $input, rb_intern("to_i"), 0, 0) );
- $1 = Date(seconds);
-}
+class Date
+{
+public:
-%typemap(out) Date {
- // Time works without require
- VALUE klass = rb_const_get( rb_cObject, rb_intern("Time"));
- VALUE rbtimenum = INT2NUM( (Date::ValueType) $1 );
- $result = rb_funcall( klass, rb_intern("at"), 1, rbtimenum);
-}
+ Date();
+ Date(const std::string & seconds_r);
-#endif
+ static Date now();
+
+ std::string form(const std::string & format_r) const;
+ std::string asString() const;
+ std::string asSeconds() const;
+
+};