changeset 11658:f9f1af45e49a octave-forge

Some cleanup in 'name' converters. (Use 'text' functions since now equal, remove FIXME comment.)
author i7tiol
date Sat, 27 Apr 2013 09:40:51 +0000
parents 465192f682f0
children 7575dc1c0b06
files main/database/src/converters.cc
diffstat 1 files changed, 4 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/main/database/src/converters.cc	Sat Apr 27 09:35:39 2013 +0000
+++ b/main/database/src/converters.cc	Sat Apr 27 09:40:51 2013 +0000
@@ -470,49 +470,6 @@
 
 /* type name */
 
-int to_octave_str_name (const octave_pq_connection &conn,
-                        const char *c, octave_value &ov, int nb)
-{
-  return 1;
-}
-
-int to_octave_bin_name (const octave_pq_connection &conn,
-                        const char *c, octave_value &ov, int nb)
-{
-  // FIXME: should we check the string in c?
-
-  std::string s (c, nb);
-
-  ov = octave_value (s);
-
-  return 0;
-}
-
-int from_octave_str_name (const octave_pq_connection &conn,
-                          const octave_value &ov, oct_pq_dynvec_t &val)
-{
-  return 1;
-}
-
-int from_octave_bin_name (const octave_pq_connection &conn,
-                          const octave_value &ov, oct_pq_dynvec_t &val)
-{
-  std::string s = ov.string_value ();
-
-  if (error_state)
-    {
-      error ("can not convert octave_value to string");
-      return 1;
-    }
-
-  octave_idx_type l = s.size ();
-
-  for (int i = 0; i < l; i++)
-    val.push_back (s[i]);
-
-  return 0;
-}
-
 oct_pq_conv_t conv_name = {0,
                            0,
                            oct_pq_el_oids_t (),
@@ -521,10 +478,10 @@
                            false,
                            false,
                            "name",
-                           &to_octave_str_name,
-                           &to_octave_bin_name,
-                           &from_octave_str_name,
-                           &from_octave_bin_name};
+                           &to_octave_str_text,
+                           &to_octave_bin_text,
+                           &from_octave_str_text,
+                           &from_octave_bin_text};
 
 /* end type name */