[libvtemm] Forgot to add new files in previous commit.



commit 1733ca0fd0c73f4cf8d64fcf8ccebc0e29bbc93d
Author: Krzesimir Nowak <krnowak svn gnome org>
Date:   Tue May 19 23:47:58 2009 +0200

    Forgot to add new files in previous commit.
    
    * src/libvtemm/internalroutines.cc:
    * src/libvtemm/internalroutines.h: New files. get_c_string and
    get_c_string_vector were moved here.
    * src/libvtemm/shared.h: New file. StdStringArrayHandle typedef
    was moved here.
---
 src/libvtemm/internalroutines.cc |   58 ++++++++++++++++++++++++++++++++++++++
 src/libvtemm/internalroutines.h  |   42 +++++++++++++++++++++++++++
 src/libvtemm/shared.h            |   39 +++++++++++++++++++++++++
 3 files changed, 139 insertions(+), 0 deletions(-)

diff --git a/src/libvtemm/internalroutines.cc b/src/libvtemm/internalroutines.cc
new file mode 100644
index 0000000..7b6674b
--- /dev/null
+++ b/src/libvtemm/internalroutines.cc
@@ -0,0 +1,58 @@
+/* internalroutines.cc
+ *
+ * Copyright (C) 2008, 2009 libvtemm Development Team
+ *
+ * This file is part of libvtemm.
+ *
+ * libvtemm is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * libvtemm is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser Public License
+ * along with libvtemm.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "internalroutines.h"
+
+namespace Gnome
+{
+
+namespace Vte
+{
+
+const char*
+get_c_string(const std::string& cpp_string)
+{
+  if (cpp_string.empty())
+  {
+    return 0;
+  }
+  return cpp_string.c_str();
+}
+
+char**
+get_c_string_vector(const StdStringArrayHandle& cpp_string_vector)
+{
+  if (cpp_string_vector.empty())
+  {
+    return 0;
+  }
+  unsigned int cpp_string_vector_len = cpp_string_vector.size();
+  char** c_string_vector = reinterpret_cast<char**>(g_malloc0(cpp_string_vector_len + 1));
+  const char* const * temp_c_string_vector = cpp_string_vector.data();
+  for (unsigned int iter = 0; iter < cpp_string_vector_len; iter++)
+  {
+    c_string_vector[iter] = g_strdup(temp_c_string_vector[iter]);
+  }
+  return c_string_vector;
+}
+
+} // namespace Vte
+
+} // namespace Gnome
diff --git a/src/libvtemm/internalroutines.h b/src/libvtemm/internalroutines.h
new file mode 100644
index 0000000..5d19c5d
--- /dev/null
+++ b/src/libvtemm/internalroutines.h
@@ -0,0 +1,42 @@
+/* internalroutines.h
+ *
+ * Copyright (C) 2008, 2009 libvtemm Development Team
+ *
+ * This file is part of libvtemm.
+ *
+ * libvtemm is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * libvtemm is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser Public License
+ * along with libvtemm.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _LIBVTEMM_INTERNAL_ROUTINES_H_
+#define _LIBVTEMM_INTERNAL_ROUTINES_H_
+
+#include <libvtemm/shared.h>
+
+namespace Gnome
+{
+
+namespace Vte
+{
+
+const char*
+get_c_string(const std::string& cpp_string);
+
+char**
+get_c_string_vector(const StdStringArrayHandle& cpp_string_vector);
+
+} // namespace Vte
+
+} // namespace Gnome
+
+#endif // _LIBVTEMM_INTERNAL_ROUTINES_H_
diff --git a/src/libvtemm/shared.h b/src/libvtemm/shared.h
new file mode 100644
index 0000000..c83a244
--- /dev/null
+++ b/src/libvtemm/shared.h
@@ -0,0 +1,39 @@
+/* shared.h
+ *
+ * Copyright (C) 2008, 2009 libvtemm Development Team
+ *
+ * This file is part of libvtemm.
+ *
+ * libvtemm is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * libvtemm is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser Public License
+ * along with libvtemm.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _LIBVTEMM_SHARED_H_
+#define _LIBVTEMM_SHARED_H_
+
+#include <glibmm/arrayhandle.h>
+#include <string>
+
+namespace Gnome
+{
+
+namespace Vte
+{
+
+typedef Glib::ArrayHandle<std::string> StdStringArrayHandle;
+
+} // namespace Vte
+
+} // namespace Gnome
+
+#endif // _LIBVTEMM_SHARED_H_



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