1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <glibmm/shell.h>
4 #include <glibmm/private/shell_p.h>
9 /* Copyright (C) 2002 The gtkmm Development Team
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public
22 * License along with this library; if not, write to the Free
23 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include <glibmm/utility.h>
32 /**** shell utility functions **********************************************/
34 Glib::ArrayHandle<std::string> shell_parse_argv(const std::string& command_line)
40 g_shell_parse_argv(command_line.c_str(), &argc, &argv, &error);
43 Glib::Error::throw_exception(error);
45 return Glib::ArrayHandle<std::string>(argv, argc, Glib::OWNERSHIP_DEEP);
48 std::string shell_quote(const std::string& unquoted_string)
50 const ScopedPtr<char> buf (g_shell_quote(unquoted_string.c_str()));
51 return std::string(buf.get());
54 std::string shell_unquote(const std::string& quoted_string)
57 char *const buf = g_shell_unquote(quoted_string.c_str(), &error);
60 Glib::Error::throw_exception(error);
62 return std::string(ScopedPtr<char>(buf).get());
70 } // anonymous namespace
73 Glib::ShellError::ShellError(Glib::ShellError::Code error_code, const Glib::ustring& error_message)
75 Glib::Error (G_SHELL_ERROR, error_code, error_message)
78 Glib::ShellError::ShellError(GError* gobject)
83 Glib::ShellError::Code Glib::ShellError::code() const
85 return static_cast<Code>(Glib::Error::code());
88 void Glib::ShellError::throw_func(GError* gobject)
90 throw Glib::ShellError(gobject);