[glibmm/vector] Make Glib use ArrayHandler instead of VectorHandler.



commit 579c54bb53502c7f6127d2d3a989fb470932420b
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Fri Jan 21 11:45:15 2011 +0100

    Make Glib use ArrayHandler instead of VectorHandler.
    
    No need for ListHandler nor SListHandler detected.

 glib/src/keyfile.ccg     |   24 ++++++++++++------------
 glib/src/keyfile.hg      |    4 ++--
 glib/src/optiongroup.ccg |    2 +-
 glib/src/regex.ccg       |    2 +-
 glib/src/regex.hg        |    2 +-
 glib/src/shell.ccg       |    2 +-
 glib/src/spawn.ccg       |   18 +++++++++---------
 7 files changed, 27 insertions(+), 27 deletions(-)
---
diff --git a/glib/src/keyfile.ccg b/glib/src/keyfile.ccg
index f93faba..6a11751 100644
--- a/glib/src/keyfile.ccg
+++ b/glib/src/keyfile.ccg
@@ -92,7 +92,7 @@ std::vector<Glib::ustring> KeyFile::get_groups() const
   gsize length = 0;
   char** const array = g_key_file_get_groups(const_cast<GKeyFile*>(gobj()), &length);
 
-  return Glib::VectorHandler<Glib::ustring>::array_to_vector(array, length, Glib::OWNERSHIP_DEEP);
+  return Glib::ArrayHandler<Glib::ustring>::array_to_vector(array, length, Glib::OWNERSHIP_DEEP);
 }
 
 std::vector<Glib::ustring> KeyFile::get_keys(const Glib::ustring& group_name) const
@@ -108,7 +108,7 @@ std::vector<Glib::ustring> KeyFile::get_keys(const Glib::ustring& group_name) co
   if(gerror)
     Glib::Error::throw_exception(gerror);
 
-  return Glib::VectorHandler<Glib::ustring>::array_to_vector(array, length, Glib::OWNERSHIP_DEEP);
+  return Glib::ArrayHandler<Glib::ustring>::array_to_vector(array, length, Glib::OWNERSHIP_DEEP);
 }
 
 Glib::ustring KeyFile::get_locale_string(const Glib::ustring& group_name,
@@ -208,7 +208,7 @@ std::vector<Glib::ustring> KeyFile::get_string_list(const Glib::ustring& group_n
 
   GLIBMM_THROW(gerror);
 
-  return Glib::VectorHandler<Glib::ustring>::array_to_vector(array, length, Glib::OWNERSHIP_DEEP);
+  return Glib::ArrayHandler<Glib::ustring>::array_to_vector(array, length, Glib::OWNERSHIP_DEEP);
 }
 
 std::vector<Glib::ustring> KeyFile::get_locale_string_list(const Glib::ustring& group_name,
@@ -226,7 +226,7 @@ std::vector<Glib::ustring> KeyFile::get_locale_string_list(const Glib::ustring&
 
   GLIBMM_THROW(gerror);
 
-  return Glib::VectorHandler<Glib::ustring>::array_to_vector(array, length, Glib::OWNERSHIP_DEEP);
+  return Glib::ArrayHandler<Glib::ustring>::array_to_vector(array, length, Glib::OWNERSHIP_DEEP);
 }
 
 std::vector<bool> KeyFile::get_boolean_list(const Glib::ustring& group_name,
@@ -243,7 +243,7 @@ std::vector<bool> KeyFile::get_boolean_list(const Glib::ustring& group_name,
 
   GLIBMM_THROW(gerror);
 
-  return Glib::VectorHandler<bool>::array_to_vector(array, length, Glib::OWNERSHIP_SHALLOW);
+  return Glib::ArrayHandler<bool>::array_to_vector(array, length, Glib::OWNERSHIP_SHALLOW);
 }
 
 std::vector<int> KeyFile::get_integer_list(const Glib::ustring& group_name,
@@ -260,7 +260,7 @@ std::vector<int> KeyFile::get_integer_list(const Glib::ustring& group_name,
 
   GLIBMM_THROW(gerror);
 
-  return Glib::VectorHandler<int>::array_to_vector(array, length, Glib::OWNERSHIP_SHALLOW);
+  return Glib::ArrayHandler<int>::array_to_vector(array, length, Glib::OWNERSHIP_SHALLOW);
 }
 
 std::vector<double> KeyFile::get_double_list(const Glib::ustring& group_name,
@@ -275,14 +275,14 @@ std::vector<double> KeyFile::get_double_list(const Glib::ustring& group_name,
                                                    &length, &gerror);
   GLIBMM_THROW(gerror);
 
-  return Glib::VectorHandler<double>::array_to_vector(array, length, Glib::OWNERSHIP_SHALLOW);
+  return Glib::ArrayHandler<double>::array_to_vector(array, length, Glib::OWNERSHIP_SHALLOW);
 }
 
 void KeyFile::set_string_list(const Glib::ustring& group_name, const Glib::ustring& key,
                               const std::vector<Glib::ustring>& list)
 {
   g_key_file_set_string_list(gobj(), (group_name.empty()) ? 0 : group_name.c_str(),
-                             key.c_str(), Glib::VectorHandler<Glib::ustring>::vector_to_array(list).data(), list.size());
+                             key.c_str(), Glib::ArrayHandler<Glib::ustring>::vector_to_array(list).data(), list.size());
 }
 
 void KeyFile::set_locale_string_list(const Glib::ustring& group_name,
@@ -290,28 +290,28 @@ void KeyFile::set_locale_string_list(const Glib::ustring& group_name,
                                      const std::vector<Glib::ustring>& list)
 {
   g_key_file_set_locale_string_list(gobj(), (group_name.empty()) ? 0 : group_name.c_str(),
-                                    key.c_str(), locale.c_str(), Glib::VectorHandler<Glib::ustring>::vector_to_array(list).data(), list.size());
+                                    key.c_str(), locale.c_str(), Glib::ArrayHandler<Glib::ustring>::vector_to_array(list).data(), list.size());
 }
 
 void KeyFile::set_integer_list(const Glib::ustring& group_name, const Glib::ustring& key,
                                const std::vector<int>& list)
 {
   g_key_file_set_integer_list(gobj(), (group_name.empty()) ? 0 : group_name.c_str(),
-                              key.c_str(), Glib::VectorHandler<int>::vector_to_array(list).data(), list.size());
+                              key.c_str(), Glib::ArrayHandler<int>::vector_to_array(list).data(), list.size());
 }
 
 void KeyFile::set_double_list(const Glib::ustring& group_name, const Glib::ustring& key,
                               const std::vector<double>& list)
 {
   g_key_file_set_double_list(gobj(), group_name.c_str(), key.c_str(),
-                             Glib::VectorHandler<double>::vector_to_array(list).data(), list.size());
+                             Glib::ArrayHandler<double>::vector_to_array(list).data(), list.size());
 }
 
 void KeyFile::set_boolean_list(const Glib::ustring& group_name, const Glib::ustring& key,
                                const std::vector<bool>& list)
 {
   g_key_file_set_boolean_list(gobj(), (group_name.empty()) ? 0 : group_name.c_str(),
-                              key.c_str(), Glib::VectorHandler<bool>::vector_to_array(list).data(), list.size());
+                              key.c_str(), Glib::ArrayHandler<bool>::vector_to_array(list).data(), list.size());
 }
 
 Glib::ustring KeyFile::get_comment() const
diff --git a/glib/src/keyfile.hg b/glib/src/keyfile.hg
index dbff869..53c5a20 100644
--- a/glib/src/keyfile.hg
+++ b/glib/src/keyfile.hg
@@ -132,8 +132,8 @@ public:
   bool load_from_data(const Glib::ustring& data, KeyFileFlags flags = Glib::KEY_FILE_NONE);
   _IGNORE(g_key_file_load_from_data)
 
-#m4 _CONVERSION(`const std::vector<std::string>&', `const gchar**', `const_cast<const gchar**>(VectorHandler<std::string>::vector_to_array($3).data())')
-#m4 _CONVERSION(`std::vector<std::string>&', `gchar**', `const_cast<gchar**>(VectorHandler<std::string>::vector_to_array($3).data())')
+#m4 _CONVERSION(`const std::vector<std::string>&', `const gchar**', `const_cast<const gchar**>(ArrayHandler<std::string>::vector_to_array($3).data())')
+#m4 _CONVERSION(`std::vector<std::string>&', `gchar**', `const_cast<gchar**>(ArrayHandler<std::string>::vector_to_array($3).data())')
   _WRAP_METHOD(bool load_from_dirs(const std::string& file, const std::vector<std::string>& search_dirs, std::vector<std::string>& full_path, KeyFileFlags flags = Glib::KEY_FILE_NONE), g_key_file_load_from_dirs, errthrow)
 
   /** Looks for a KeyFile named @a file in the paths returned from
diff --git a/glib/src/optiongroup.ccg b/glib/src/optiongroup.ccg
index 876ec7c..94e4d23 100644
--- a/glib/src/optiongroup.ccg
+++ b/glib/src/optiongroup.ccg
@@ -507,7 +507,7 @@ void OptionGroup::CppOptionEntry::convert_c_to_cpp()
         typed_cpp_arg->clear();
 
         // TODO: ask someone to test if this compiles on SUN Forte and Tru64 compilers.
-        (*typed_cpp_arg) = Glib::VectorHandler<Glib::ustring>::array_to_vector(*typed_arg, Glib::OWNERSHIP_NONE);
+        (*typed_cpp_arg) = Glib::ArrayHandler<Glib::ustring>::array_to_vector(*typed_arg, Glib::OWNERSHIP_NONE);
 
         //The C array seems to be null-terminated.
         //std::vector<Glib::ustring> vec(*typed_arg,  Glib::OWNERSHIP_NONE);
diff --git a/glib/src/regex.ccg b/glib/src/regex.ccg
index 964ae80..d2d1ba6 100644
--- a/glib/src/regex.ccg
+++ b/glib/src/regex.ccg
@@ -229,7 +229,7 @@ Glib::ustring Regex::replace_literal(const Glib::ustring& string, int start_posi
 std::vector<Glib::ustring> Regex::split(const Glib::ustring& string, int start_position, RegexMatchFlags match_options, int max_tokens) const
 {
   GError* gerror = 0;
-  std::vector<Glib::ustring> retvalue = Glib::VectorHandler<Glib::ustring>::array_to_vector(g_regex_split_full(const_cast<GRegex*>(gobj()), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), max_tokens, &(gerror)), Glib::OWNERSHIP_DEEP);
+  std::vector<Glib::ustring> retvalue = Glib::ArrayHandler<Glib::ustring>::array_to_vector(g_regex_split_full(const_cast<GRegex*>(gobj()), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), max_tokens, &(gerror)), Glib::OWNERSHIP_DEEP);
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
diff --git a/glib/src/regex.hg b/glib/src/regex.hg
index 8bff63c..700c60b 100644
--- a/glib/src/regex.hg
+++ b/glib/src/regex.hg
@@ -186,7 +186,7 @@ public:
    */
   bool match_all(const Glib::ustring& string, gssize string_len, int start_position, RegexMatchFlags match_options);
 
-#m4 _CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::VectorHandler<Glib::ustring>::array_to_vector ($3, Glib::OWNERSHIP_DEEP)')
+#m4 _CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector ($3, Glib::OWNERSHIP_DEEP)')
 
   _WRAP_METHOD(static std::vector<Glib::ustring> split_simple(const Glib::ustring& pattern, const Glib::ustring& string, RegexCompileFlags compile_options = static_cast<RegexCompileFlags>(0), RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)), g_regex_split_simple)
   _WRAP_METHOD(std::vector<Glib::ustring> split(const Glib::ustring& string, RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)), g_regex_split)
diff --git a/glib/src/shell.ccg b/glib/src/shell.ccg
index 213ee5f..d654845 100644
--- a/glib/src/shell.ccg
+++ b/glib/src/shell.ccg
@@ -37,7 +37,7 @@ std::vector<std::string> shell_parse_argv(const std::string& command_line)
   if(error)
     Glib::Error::throw_exception(error);
 
-  return Glib::VectorHandler<std::string>::array_to_vector(argv, argc, Glib::OWNERSHIP_DEEP);
+  return Glib::ArrayHandler<std::string>::array_to_vector(argv, argc, Glib::OWNERSHIP_DEEP);
 }
 
 std::string shell_quote(const std::string& unquoted_string)
diff --git a/glib/src/spawn.ccg b/glib/src/spawn.ccg
index cad17ed..132f450 100644
--- a/glib/src/spawn.ccg
+++ b/glib/src/spawn.ccg
@@ -83,8 +83,8 @@ void spawn_async_with_pipes(const std::string& working_directory,
 
   g_spawn_async_with_pipes(
       (working_directory.empty()) ? 0 : working_directory.c_str(),
-      const_cast<char**>(Glib::VectorHandler<std::string>::vector_to_array (argv).data()),
-      const_cast<char**>(Glib::VectorHandler<std::string>::vector_to_array (envp).data()),
+      const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array (argv).data()),
+      const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array (envp).data()),
       static_cast<GSpawnFlags>(unsigned(flags)),
       (setup_slot) ? &child_setup_callback : 0,
       (setup_slot) ? &child_setup_         : 0,
@@ -111,7 +111,7 @@ void spawn_async_with_pipes(const std::string& working_directory,
 
   g_spawn_async_with_pipes(
       (working_directory.empty()) ? 0 : working_directory.c_str(),
-      const_cast<char**>(Glib::VectorHandler<std::string>::vector_to_array (argv).data()), 0,
+      const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array (argv).data()), 0,
       static_cast<GSpawnFlags>(unsigned(flags)),
       (setup_slot) ? &child_setup_callback : 0,
       (setup_slot) ? &child_setup_         : 0,
@@ -136,8 +136,8 @@ void spawn_async(const std::string& working_directory,
 
   g_spawn_async(
       (working_directory.empty()) ? 0 : working_directory.c_str(),
-      const_cast<char**>(Glib::VectorHandler<std::string>::vector_to_array (argv).data()),
-      const_cast<char**>(Glib::VectorHandler<std::string>::vector_to_array (envp).data()),
+      const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array (argv).data()),
+      const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array (envp).data()),
       static_cast<GSpawnFlags>(unsigned(flags)),
       (setup_slot) ? &child_setup_callback : 0,
       (setup_slot) ? &child_setup_         : 0,
@@ -160,7 +160,7 @@ void spawn_async(const std::string& working_directory,
 
   g_spawn_async(
       (working_directory.empty()) ? 0 : working_directory.c_str(),
-      const_cast<char**>(Glib::VectorHandler<std::string>::vector_to_array (argv).data()), 0,
+      const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array (argv).data()), 0,
       static_cast<GSpawnFlags>(unsigned(flags)),
       (setup_slot) ? &child_setup_callback : 0,
       (setup_slot) ? &child_setup_         : 0,
@@ -189,8 +189,8 @@ void spawn_sync(const std::string& working_directory,
 
   g_spawn_sync(
       (working_directory.empty()) ? 0 : working_directory.c_str(),
-      const_cast<char**>(Glib::VectorHandler<std::string>::vector_to_array (argv).data()),
-      const_cast<char**>(Glib::VectorHandler<std::string>::vector_to_array (envp).data()),
+      const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array (argv).data()),
+      const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array (envp).data()),
       static_cast<GSpawnFlags>(unsigned(flags)),
       (setup_slot) ? &child_setup_callback : 0,
       (setup_slot) ? &child_setup_         : 0,
@@ -223,7 +223,7 @@ void spawn_sync(const std::string& working_directory,
 
   g_spawn_sync(
       (working_directory.empty()) ? 0 : working_directory.c_str(),
-      const_cast<char**>(Glib::VectorHandler<std::string>::vector_to_array (argv).data()), 0,
+      const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array (argv).data()), 0,
       static_cast<GSpawnFlags>(unsigned(flags)),
       (setup_slot) ? &child_setup_callback : 0,
       (setup_slot) ? &child_setup_         : 0,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]