[Debian-astro-commits] [gyoto] 106/221: support string and filename Property types in Yorick

Thibaut Jean-Claude Paumard thibaut at moszumanska.debian.org
Fri May 22 20:52:38 UTC 2015


This is an automated email from the git hooks/post-receive script.

thibaut pushed a commit to branch master
in repository gyoto.

commit d42c33c4bb514ecffa7816f9de62bf0fec5f94a6
Author: Thibaut Paumard <paumard at users.sourceforge.net>
Date:   Tue Nov 25 17:59:43 2014 +0100

    support string and filename Property types in Yorick
---
 yorick/gyoto_utils.C | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/yorick/gyoto_utils.C b/yorick/gyoto_utils.C
index 4cff883..8ee8477 100644
--- a/yorick/gyoto_utils.C
+++ b/yorick/gyoto_utils.C
@@ -369,6 +369,14 @@ void ypush_property(Gyoto::SmartPointer<Gyoto::SmartPointee> ptr,
       ypush_double(val);
     }
     break;
+  case Gyoto::Property::string_t:
+  case Gyoto::Property::filename_t:
+    {
+      string val;
+      ptr->get(p, val);
+      *ypush_q(0) = p_strcpy(val.c_str());
+    }
+    break;
   default:
     y_error("Property type unimplemented in ypush_property()");
    }
@@ -377,7 +385,6 @@ void ypush_property(Gyoto::SmartPointer<Gyoto::SmartPointee> ptr,
 void yget_property(Gyoto::SmartPointer<Gyoto::SmartPointee> ptr,
 		   Gyoto::Property const& p, int iarg, std::string name,
 		   std::string unit) {
-  cerr << "dummy: should get property" << endl;
   switch(p.type) {
   case Gyoto::Property::bool_t:
     {
@@ -389,6 +396,10 @@ void yget_property(Gyoto::SmartPointer<Gyoto::SmartPointee> ptr,
   case Gyoto::Property::double_t:
     ptr->set(p, ygets_d(iarg), unit);
     break;
+  case Gyoto::Property::filename_t:
+  case Gyoto::Property::string_t:
+    ptr -> set(p, string(ygets_q(iarg)));
+    return;
   default:
     y_error("Property type unimplemented in yget_property()");
    }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/gyoto.git



More information about the Debian-astro-commits mailing list