"Fossies" - the Fresh Open Source Software Archive

Member "glibmm-2.76.0/untracked/gio/giomm/applicationcommandline.cc" (12 Mar 2023, 6719 Bytes) of package /linux/misc/glibmm-2.76.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "applicationcommandline.cc" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.74.1_vs_2.76.0.

    1 // Generated by gmmproc 2.76.0 -- DO NOT MODIFY!
    2 
    3 
    4 #include <glibmm.h>
    5 
    6 #include <giomm/applicationcommandline.h>
    7 #include <giomm/private/applicationcommandline_p.h>
    8 
    9 
   10 /* Copyright (C) 2010 Jonathon Jongsma <jonathon@quotidian.org>
   11  *
   12  * This library is free software; you can redistribute it and/or
   13  * modify it under the terms of the GNU Lesser General Public
   14  * License as published by the Free Software Foundation; either
   15  * version 2.1 of the License, or (at your option) any later version.
   16  *
   17  * This library is distributed in the hope that it will be useful,
   18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   20  * Lesser General Public License for more details.
   21  *
   22  * You should have received a copy of the GNU Lesser General Public
   23  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
   24  */
   25 
   26 #include <gio/gio.h>
   27 #include <glibmm/vectorutils.h>
   28 
   29 namespace Gio
   30 {
   31 
   32 void
   33 ApplicationCommandLine::print(const Glib::ustring& message)
   34 {
   35   g_application_command_line_print(gobj(), "%s", message.c_str());
   36 }
   37 
   38 void
   39 ApplicationCommandLine::printerr(const Glib::ustring& message)
   40 {
   41   g_application_command_line_printerr(gobj(), "%s", message.c_str());
   42 }
   43 
   44 } // namespace Gio
   45 
   46 namespace
   47 {
   48 } // anonymous namespace
   49 
   50 
   51 namespace Glib
   52 {
   53 
   54 Glib::RefPtr<Gio::ApplicationCommandLine> wrap(GApplicationCommandLine* object, bool take_copy)
   55 {
   56   return Glib::make_refptr_for_instance<Gio::ApplicationCommandLine>( dynamic_cast<Gio::ApplicationCommandLine*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
   57   //We use dynamic_cast<> in case of multiple inheritance.
   58 }
   59 
   60 } /* namespace Glib */
   61 
   62 
   63 namespace Gio
   64 {
   65 
   66 
   67 /* The *_Class implementation: */
   68 
   69 const Glib::Class& ApplicationCommandLine_Class::init()
   70 {
   71   if(!gtype_) // create the GType if necessary
   72   {
   73     // Glib::Class has to know the class init function to clone custom types.
   74     class_init_func_ = &ApplicationCommandLine_Class::class_init_function;
   75 
   76     // This is actually just optimized away, apparently with no harm.
   77     // Make sure that the parent type has been created.
   78     //CppClassParent::CppObjectType::get_type();
   79 
   80     // Create the wrapper type, with the same class/instance size as the base type.
   81     register_derived_type(g_application_command_line_get_type());
   82 
   83     // Add derived versions of interfaces, if the C type implements any interfaces:
   84 
   85   }
   86 
   87   return *this;
   88 }
   89 
   90 
   91 void ApplicationCommandLine_Class::class_init_function(void* g_class, void* class_data)
   92 {
   93   const auto klass = static_cast<BaseClassType*>(g_class);
   94   CppClassParent::class_init_function(klass, class_data);
   95 
   96 
   97 }
   98 
   99 
  100 Glib::ObjectBase* ApplicationCommandLine_Class::wrap_new(GObject* object)
  101 {
  102   return new ApplicationCommandLine((GApplicationCommandLine*)object);
  103 }
  104 
  105 
  106 /* The implementation: */
  107 
  108 GApplicationCommandLine* ApplicationCommandLine::gobj_copy()
  109 {
  110   reference();
  111   return gobj();
  112 }
  113 
  114 ApplicationCommandLine::ApplicationCommandLine(const Glib::ConstructParams& construct_params)
  115 :
  116   Glib::Object(construct_params)
  117 {
  118 
  119 }
  120 
  121 ApplicationCommandLine::ApplicationCommandLine(GApplicationCommandLine* castitem)
  122 :
  123   Glib::Object((GObject*)(castitem))
  124 {}
  125 
  126 
  127 ApplicationCommandLine::ApplicationCommandLine(ApplicationCommandLine&& src) noexcept
  128 : Glib::Object(std::move(src))
  129 {}
  130 
  131 ApplicationCommandLine& ApplicationCommandLine::operator=(ApplicationCommandLine&& src) noexcept
  132 {
  133   Glib::Object::operator=(std::move(src));
  134   return *this;
  135 }
  136 
  137 
  138 ApplicationCommandLine::~ApplicationCommandLine() noexcept
  139 {}
  140 
  141 
  142 ApplicationCommandLine::CppClassType ApplicationCommandLine::applicationcommandline_class_; // initialize static member
  143 
  144 GType ApplicationCommandLine::get_type()
  145 {
  146   return applicationcommandline_class_.init().get_type();
  147 }
  148 
  149 
  150 GType ApplicationCommandLine::get_base_type()
  151 {
  152   return g_application_command_line_get_type();
  153 }
  154 
  155 
  156 ApplicationCommandLine::ApplicationCommandLine()
  157 :
  158   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  159   Glib::ObjectBase(nullptr),
  160   Glib::Object(Glib::ConstructParams(applicationcommandline_class_.init()))
  161 {
  162   
  163 
  164 }
  165 
  166 char** ApplicationCommandLine::get_arguments(int& argc) const
  167 {
  168   return g_application_command_line_get_arguments(const_cast<GApplicationCommandLine*>(gobj()), &(argc));
  169 }
  170 
  171 Glib::RefPtr<Glib::VariantDict> ApplicationCommandLine::get_options_dict()
  172 {
  173   auto retvalue = Glib::wrap(g_application_command_line_get_options_dict(gobj()));
  174   if(retvalue)
  175     retvalue->reference(); //The function does not do a ref for us.
  176   return retvalue;
  177 }
  178 
  179 Glib::RefPtr<const Glib::VariantDict> ApplicationCommandLine::get_options_dict() const
  180 {
  181   return const_cast<ApplicationCommandLine*>(this)->get_options_dict();
  182 }
  183 
  184 Glib::RefPtr<InputStream> ApplicationCommandLine::get_stdin()
  185 {
  186   auto retvalue = Glib::wrap(g_application_command_line_get_stdin(gobj()));
  187   if(retvalue)
  188     retvalue->reference(); //The function does not do a ref for us.
  189   return retvalue;
  190 }
  191 
  192 Glib::RefPtr<const InputStream> ApplicationCommandLine::get_stdin() const
  193 {
  194   return const_cast<ApplicationCommandLine*>(this)->get_stdin();
  195 }
  196 
  197 std::string ApplicationCommandLine::get_cwd() const
  198 {
  199   return Glib::convert_const_gchar_ptr_to_stdstring(g_application_command_line_get_cwd(const_cast<GApplicationCommandLine*>(gobj())));
  200 }
  201 
  202 std::vector<std::string> ApplicationCommandLine::get_environ() const
  203 {
  204   return Glib::ArrayHandler<std::string>::array_to_vector(g_application_command_line_get_environ(const_cast<GApplicationCommandLine*>(gobj())), Glib::OWNERSHIP_NONE);
  205 }
  206 
  207 std::string ApplicationCommandLine::getenv(const Glib::ustring& name) const
  208 {
  209   return Glib::convert_const_gchar_ptr_to_stdstring(g_application_command_line_getenv(const_cast<GApplicationCommandLine*>(gobj()), name.c_str()));
  210 }
  211 
  212 bool ApplicationCommandLine::is_remote() const
  213 {
  214   return g_application_command_line_get_is_remote(const_cast<GApplicationCommandLine*>(gobj()));
  215 }
  216 
  217 Glib::Variant< std::map<Glib::ustring, Glib::VariantBase> > ApplicationCommandLine::get_platform_data() const
  218 {
  219   return Glib::Variant< std::map<Glib::ustring, Glib::VariantBase> >(g_application_command_line_get_platform_data(const_cast<GApplicationCommandLine*>(gobj())));
  220 }
  221 
  222 void ApplicationCommandLine::set_exit_status(int exit_status)
  223 {
  224   g_application_command_line_set_exit_status(gobj(), exit_status);
  225 }
  226 
  227 int ApplicationCommandLine::get_exit_status() const
  228 {
  229   return g_application_command_line_get_exit_status(const_cast<GApplicationCommandLine*>(gobj()));
  230 }
  231 
  232 Glib::RefPtr<File> ApplicationCommandLine::create_file_for_arg(const Glib::ustring& arg) const
  233 {
  234   return Glib::wrap(g_application_command_line_create_file_for_arg(const_cast<GApplicationCommandLine*>(gobj()), arg.c_str()));
  235 }
  236 
  237 
  238 } // namespace Gio
  239 
  240