1 // Generated by gmmproc 2.64.2 -- DO NOT MODIFY! 2 #ifndef _GLIBMM_OPTIONENTRY_H 3 #define _GLIBMM_OPTIONENTRY_H 4 5 6 /* Copyright (C) 2004 The glibmm Development Team 7 * 8 * This library is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Lesser General Public 10 * License as published by the Free Software Foundation; either 11 * version 2.1 of the License, or (at your option) any later version. 12 * 13 * This library is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 20 */ 21 22 23 #include <glibmm/ustring.h> 24 25 #ifndef DOXYGEN_SHOULD_SKIP_THIS 26 extern "C" { typedef struct _GOptionEntry GOptionEntry; } 27 #endif 28 29 30 namespace Glib 31 { 32 33 /** An OptionEntry defines a single option. To have an effect, it must be added to an OptionGroup with 34 * OptionGroup::add_entry(). 35 * 36 * The long name of an option can be used to specify it in a commandline as --long_name. 37 * Every option must have a long name. To resolve conflicts if multiple option groups contain the same long name, it is also 38 * possible to specify the option as --groupname-long_name. 39 * 40 * If an option has a short name, it can be specified as -short_name in a commandline. 41 * 42 * The description for the option is shown in the --help output. 43 * 44 * The arg_descripton is the placeholder to use for the extra argument parsed by the option in --help output. 45 */ 46 class GLIBMM_API OptionEntry 47 { 48 public: 49 #ifndef DOXYGEN_SHOULD_SKIP_THIS 50 using CppObjectType = OptionEntry; 51 using BaseObjectType = GOptionEntry; 52 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 53 54 private: 55 56 public: 57 58 //Copied from goption.h, instead of generated, so that we can put it inside the class. 59 enum Flags 60 { 61 FLAG_HIDDEN = 1 << 0, 62 FLAG_IN_MAIN = 1 << 1, 63 FLAG_REVERSE = 1 << 2, 64 FLAG_NO_ARG = 1 << 3, 65 FLAG_FILENAME = 1 << 4, 66 FLAG_OPTIONAL_ARG = 1 << 5, 67 FLAG_NOALIAS = 1 << 6 68 } GOptionFlags; 69 70 OptionEntry(); 71 OptionEntry(const OptionEntry& src); 72 73 OptionEntry(OptionEntry&& other) noexcept; 74 OptionEntry& operator=(OptionEntry&& other) noexcept; 75 76 virtual ~OptionEntry(); 77 78 OptionEntry& operator=(const OptionEntry& src); 79 80 //#m4 __CONVERSION(`Glib::ustring',`const gchar*',`($3).empty() ? nullptr : g_strdup(($3).c_str())') 81 82 Glib::ustring get_long_name() const; 83 84 void set_long_name(const Glib::ustring& value); 85 86 gchar get_short_name() const; 87 void set_short_name(const gchar& value); 88 89 int get_flags() const; 90 91 /** Set one or more OptionEntry::Flags. 92 * Do not set FLAG_FILENAME. Character encoding is chosen when the OptionEntry 93 * is added to an OptionGroup. 94 */ 95 void set_flags(const int& value); 96 97 Glib::ustring get_description() const; 98 99 void set_description(const Glib::ustring& value); 100 101 Glib::ustring get_arg_description() const; 102 103 void set_arg_description(const Glib::ustring& value); 104 gobj()105 GOptionEntry* gobj() { return gobject_; } gobj()106 const GOptionEntry* gobj() const { return gobject_; } 107 108 private: 109 void release_gobject() noexcept; 110 111 protected: 112 113 GOptionEntry* gobject_; 114 115 116 }; 117 118 } // namespace Glib 119 120 121 #endif /* _GLIBMM_OPTIONENTRY_H */ 122 123