[glibmm] Keyfile: Change KeyfileFlags to Keyfile::Flags.



commit fb5277634fe254b1af4a43ed07f8a33b50297ed4
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Apr 18 20:10:13 2017 +0200

    Keyfile: Change KeyfileFlags to Keyfile::Flags.

 glib/src/keyfile.ccg     |    6 +++---
 glib/src/keyfile.hg      |   12 ++++++------
 tools/m4/convert_glib.m4 |    2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/glib/src/keyfile.ccg b/glib/src/keyfile.ccg
index 30a6ef7..ce14bed 100644
--- a/glib/src/keyfile.ccg
+++ b/glib/src/keyfile.ccg
@@ -61,7 +61,7 @@ KeyFile::~KeyFile()
 }
 
 bool
-KeyFile::load_from_data(const Glib::ustring& data, KeyFileFlags flags)
+KeyFile::load_from_data(const Glib::ustring& data, Flags flags)
 {
   GError* gerror = nullptr;
 
@@ -75,7 +75,7 @@ KeyFile::load_from_data(const Glib::ustring& data, KeyFileFlags flags)
 }
 
 bool
-KeyFile::load_from_data_dirs(const std::string& file, std::string& full_path, KeyFileFlags flags)
+KeyFile::load_from_data_dirs(const std::string& file, std::string& full_path, Flags flags)
 {
   GError* gerror = nullptr;
   char* full_path_c = nullptr;
@@ -96,7 +96,7 @@ KeyFile::load_from_data_dirs(const std::string& file, std::string& full_path, Ke
 
 bool
 KeyFile::load_from_dirs(const std::string& file, const std::vector<std::string>&  search_dirs,
-  std::string& full_path, KeyFileFlags flags)
+  std::string& full_path, Flags flags)
 {
   GError* gerror = nullptr;
   char* full_path_c = nullptr;
diff --git a/glib/src/keyfile.hg b/glib/src/keyfile.hg
index c2f8659..e33b1d8 100644
--- a/glib/src/keyfile.hg
+++ b/glib/src/keyfile.hg
@@ -31,8 +31,6 @@ extern "C" { typedef struct _GKeyFile GKeyFile; }
 namespace Glib
 {
 
-  _WRAP_ENUM(KeyFileFlags, GKeyFileFlags, NO_GTYPE)
-
 /** Exception class for KeyFile errors.
  */
 _WRAP_GERROR(KeyFileError, GKeyFileError, G_KEY_FILE_ERROR, NO_GTYPE)
@@ -97,6 +95,8 @@ class KeyFile
   _CLASS_GENERIC(KeyFile, GKeyFile)
 public:
 
+  _WRAP_ENUM(Flags, GKeyFileFlags, NO_GTYPE)
+
   //TODO: GKeyFile now seems to be a reference-counted type.
 
   //TODO: Maybe replace all the get_*/set_* methods with some generic get/set
@@ -128,7 +128,7 @@ public:
   KeyFile(GKeyFile* castitem, bool takes_ownership = false);
 
 public:
-  _WRAP_METHOD(bool load_from_file(const std::string& file, KeyFileFlags flags = Glib::KeyFileFlags::NONE), 
g_key_file_load_from_file, errthrow)
+  _WRAP_METHOD(bool load_from_file(const std::string& file, Flags flags = Flags::NONE), 
g_key_file_load_from_file, errthrow)
 
   /** Loads a KeyFile from memory
    * @param data The data to use as a KeyFile
@@ -136,7 +136,7 @@ public:
    * @return true if the KeyFile was successfully loaded, false otherwise
    * @throw Glib::KeyFileError
    */
-  bool load_from_data(const Glib::ustring& data, KeyFileFlags flags = Glib::KeyFileFlags::NONE);
+  bool load_from_data(const Glib::ustring& data, Flags flags = Flags::NONE);
   _IGNORE(g_key_file_load_from_data)
 
 #m4 _CONVERSION(`const std::vector<std::string>& ', `const gchar**', `const_cast<const gchar**>($3.data())')
@@ -144,7 +144,7 @@ public:
   _IGNORE(g_key_file_load_from_dirs)
 
   _WRAP_METHOD_DOCS_ONLY(g_key_file_load_from_dirs)
-  bool load_from_dirs(const std::string& file, const std::vector<std::string>&  search_dirs, std::string& 
full_path, KeyFileFlags flags = Glib::KeyFileFlags::NONE);
+  bool load_from_dirs(const std::string& file, const std::vector<std::string>&  search_dirs, std::string& 
full_path, Flags flags = Flags::NONE);
 
   /** Looks for a KeyFile named @a file in the paths returned from
    * g_get_user_data_dir() and g_get_system_data_dirs() and loads them
@@ -157,7 +157,7 @@ public:
    * @throw Glib::KeyFileError
    * @throw Glib::FileError
    */
-  bool load_from_data_dirs(const std::string& file, std::string& full_path, KeyFileFlags flags = 
Glib::KeyFileFlags::NONE);
+  bool load_from_data_dirs(const std::string& file, std::string& full_path, Flags flags = Flags::NONE);
   _IGNORE(g_key_file_load_from_data_dirs)
 
   /** Outputs the KeyFile as a string
diff --git a/tools/m4/convert_glib.m4 b/tools/m4/convert_glib.m4
index 0d779fa..5ef04c5 100644
--- a/tools/m4/convert_glib.m4
+++ b/tools/m4/convert_glib.m4
@@ -69,7 +69,7 @@ _CONV_GLIB_ENUM(BindingFlags)
 _CONV_GLIB_ENUM(IOCondition)
 _CONV_GLIB_ENUM(IOFlags)
 _CONV_GLIB_ENUM(IOStatus)
-_CONV_GLIB_ENUM(KeyFileFlags)
+_CONV_GLIB_INCLASS_ENUM(KeyFile,Flags)
 _CONV_GLIB_ENUM(OptionArg)
 _CONV_GLIB_INCLASS_ENUM(Regex,CompileFlags)
 _CONV_GLIB_INCLASS_ENUM(Regex,MatchFlags)


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