[glibmm/glibmm-2-54] Glib::KeyFile, OptionContext, Regex: Add exception specs to errthrow



commit 75a20866c6479a628f546bc5710073e3b41ea915
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Fri Sep 29 15:56:44 2017 +0200

    Glib::KeyFile, OptionContext, Regex: Add exception specs to errthrow

 glib/src/keyfile.hg       |   12 ++++++------
 glib/src/optioncontext.hg |    3 ++-
 glib/src/regex.hg         |   40 +++++++++++++++++++++++++---------------
 3 files changed, 33 insertions(+), 22 deletions(-)
---
diff --git a/glib/src/keyfile.hg b/glib/src/keyfile.hg
index 23e9028..80cd0ba 100644
--- a/glib/src/keyfile.hg
+++ b/glib/src/keyfile.hg
@@ -142,9 +142,9 @@ public:
 #m4 _CONVERSION(`Glib::ArrayHandle<std::string>&', `gchar**', `const_cast<gchar**>($3.data())')
 
   _WRAP_METHOD(bool load_from_dirs(const std::string& file, const Glib::ArrayHandle<std::string>& 
search_dirs, Glib::ArrayHandle<std::string>& full_path, KeyFileFlags flags = Glib::KEY_FILE_NONE),
-    g_key_file_load_from_dirs, errthrow, deprecated "Use the load_from_dirs() method that takes a 
std::string& full_path.")
+    g_key_file_load_from_dirs, errthrow "Glib::KeyFileError, Glib::FileError", errthrow, deprecated "Use the 
load_from_dirs() method that takes a std::string& full_path.")
 
-  _WRAP_METHOD_DOCS_ONLY(g_key_file_load_from_dirs)
+  _WRAP_METHOD_DOCS_ONLY(g_key_file_load_from_dirs, errthrow "Glib::KeyFileError, Glib::FileError")
   bool load_from_dirs(const std::string& file, const Glib::ArrayHandle<std::string>& search_dirs, 
std::string& full_path, KeyFileFlags flags = Glib::KEY_FILE_NONE);
 
   /** Looks for a KeyFile named @a file in the paths returned from
@@ -152,7 +152,7 @@ public:
    * into the keyfile object, placing the full path to the file in
    * @a full_path.
    * @param file The file to search for
-   * @param full_path Return location for a string containing the full path of the file
+   * @param[out] full_path Return location for a string containing the full path of the file
    * @param flags Bitwise combination of the flags to use for the KeyFile
    * @return true if the KeyFile was successfully loaded, false otherwise
    * @throw Glib::KeyFileError
@@ -168,7 +168,7 @@ public:
   Glib::ustring to_data();
   _IGNORE(g_key_file_to_data)
 
-  _WRAP_METHOD(bool save_to_file(const std::string& filename), g_key_file_save_to_file, errthrow)
+  _WRAP_METHOD(bool save_to_file(const std::string& filename), g_key_file_save_to_file, errthrow 
"Glib::FileError", errthrow)
 
   _WRAP_METHOD(Glib::ustring get_start_group() const, g_key_file_get_start_group)
 
@@ -235,7 +235,7 @@ public:
    */
   gint64 get_int64(const Glib::ustring& key) const;
 
-  _WRAP_METHOD(gint64 get_int64(const Glib::ustring& group_name, const Glib::ustring& key) const, 
g_key_file_get_int64, errthrow)
+  _WRAP_METHOD(gint64 get_int64(const Glib::ustring& group_name, const Glib::ustring& key) const, 
g_key_file_get_int64, errthrow "Glib::KeyFileError", errthrow)
 
   /** Gets the value in the first group, under @a key, interpreting it as
    * an unsigned 64-bit integer. This is similar to get_integer() but can
@@ -248,7 +248,7 @@ public:
    */
   guint64 get_uint64(const Glib::ustring& key) const;
 
-  _WRAP_METHOD(guint64 get_uint64(const Glib::ustring& group_name, const Glib::ustring& key) const, 
g_key_file_get_uint64, errthrow)
+  _WRAP_METHOD(guint64 get_uint64(const Glib::ustring& group_name, const Glib::ustring& key) const, 
g_key_file_get_uint64, errthrow "Glib::KeyFileError", errthrow)
 
   /** Gets the value in the first group, under @a key, interpreting it as
    * a double.
diff --git a/glib/src/optioncontext.hg b/glib/src/optioncontext.hg
index c40c41d..7c66591 100644
--- a/glib/src/optioncontext.hg
+++ b/glib/src/optioncontext.hg
@@ -116,7 +116,7 @@ public:
   _WRAP_METHOD(bool get_strict_posix() const, g_option_context_get_strict_posix)
 
 #m4 _CONVERSION(`char**&',`gchar***',`&($3)')
-  _WRAP_METHOD(bool parse(int& argc, char**& argv), g_option_context_parse, errthrow)
+  _WRAP_METHOD(bool parse(int& argc, char**& argv), g_option_context_parse, errthrow "Glib::OptionError, 
Glib::ConvertError", errthrow)
 
   /** Parses the command line arguments.
    *
@@ -142,6 +142,7 @@ public:
    * @return <tt>true</tt> if the parsing was successful,
    *         <tt>false</tt> if an error occurred.
    * @throw Glib::OptionError
+   * @throw Glib::ConvertError
    */
   _WRAP_METHOD(bool parse(char**& argv), g_option_context_parse_strv, errthrow)
 
diff --git a/glib/src/regex.hg b/glib/src/regex.hg
index de07fab..0555885 100644
--- a/glib/src/regex.hg
+++ b/glib/src/regex.hg
@@ -98,6 +98,7 @@ class Regex final
   _IGNORE(g_regex_ref, g_regex_unref)
 public:
 
+  /// @throws Glib::RegexError
   static Glib::RefPtr<Glib::Regex> create(const Glib::ustring& pattern, RegexCompileFlags compile_options = 
static_cast<RegexCompileFlags>(0), RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0));
 
   _WRAP_METHOD(Glib::ustring get_pattern() const, g_regex_get_pattern)
@@ -123,7 +124,9 @@ public:
   /// A match() method not requiring a Glib::MatchInfo.
   bool match(const Glib::ustring& string, RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0));
 
-  /// A match() method with a start position and a Glib::MatchInfo.
+  /** A match() method with a start position and a Glib::MatchInfo.
+   * @throws Glib::RegexError
+   */
   bool match(
     const Glib::ustring& string,
     int start_position,
@@ -131,7 +134,7 @@ public:
     RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)
   );
 
-  _WRAP_METHOD_DOCS_ONLY(g_regex_match_full)
+  _WRAP_METHOD_DOCS_ONLY(g_regex_match_full, errthrow "Glib::RegexError")
   bool match(
     const Glib::ustring& string,
     gssize string_len,
@@ -140,7 +143,9 @@ public:
     RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)
   );
 
-  /// A match() method with a start position not requiring a Glib::MatchInfo.
+  /** A match() method with a start position not requiring a Glib::MatchInfo.
+   * @throws Glib::RegexError
+   */
   bool match(const Glib::ustring& string, int start_position, RegexMatchFlags match_options);
 
   /** A match() method with a string length and start position not requiring a
@@ -158,7 +163,9 @@ public:
   /// A match_all() method not requiring a Glib::MatchInfo.
   bool match_all(const Glib::ustring& string, RegexMatchFlags match_options = 
static_cast<RegexMatchFlags>(0));
 
-  /// A match_all() method with a start positon and a Glib::MatchInfo.
+  /** A match_all() method with a start positon and a Glib::MatchInfo.
+   * @throws Glib::RegexError
+   */
   bool match_all(
     const Glib::ustring& string,
     int start_position,
@@ -166,8 +173,7 @@ public:
     RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)
   );
 
-  _WRAP_METHOD_DOCS_ONLY(g_regex_match_all_full, errthrow)
-  /// @throw Glib::Error.
+  _WRAP_METHOD_DOCS_ONLY(g_regex_match_all_full, errthrow "Glib::RegexError")
   bool match_all(
     const Glib::ustring& string,
     gssize string_len,
@@ -176,13 +182,14 @@ public:
     RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)
   );
 
-  /** A match_all() method with a start position not requiring a
-   * Glib::MatchInfo.
+  /** A match_all() method with a start position not requiring a Glib::MatchInfo.
+   * @throws Glib::RegexError
    */
   bool match_all(const Glib::ustring& string, int start_position, RegexMatchFlags match_options);
 
   /** A match_all() method with a start position and a string length not
    * requiring a Glib::MatchInfo.
+   * @throws Glib::RegexError
    */
   bool match_all(const Glib::ustring& string, gssize string_len, int start_position, RegexMatchFlags 
match_options);
 
@@ -191,18 +198,21 @@ public:
   _WRAP_METHOD(static Glib::StringArrayHandle split_simple(const Glib::ustring& pattern, const 
Glib::ustring& string, RegexCompileFlags compile_options = static_cast<RegexCompileFlags>(0), RegexMatchFlags 
match_options = static_cast<RegexMatchFlags>(0)), g_regex_split_simple)
   _WRAP_METHOD(Glib::StringArrayHandle split(const Glib::ustring& string, RegexMatchFlags match_options = 
static_cast<RegexMatchFlags>(0)), g_regex_split)
 
-  _WRAP_METHOD(Glib::StringArrayHandle split(const gchar* string, gssize string_len, int start_position, 
RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0), int max_tokens = 0) const, 
g_regex_split_full, errthrow)
+  _WRAP_METHOD(Glib::StringArrayHandle split(const gchar* string, gssize string_len, int start_position, 
RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0), int max_tokens = 0) const, 
g_regex_split_full, errthrow "Glib::RegexError", errthrow)
 
+  /// @throws Glib::RegexError
   Glib::StringArrayHandle split(const Glib::ustring& string, int start_position, RegexMatchFlags 
match_options, int max_tokens) const;
 
-  _WRAP_METHOD(Glib::ustring replace(const gchar* string, gssize string_len, int start_position, const 
Glib::ustring& replacement, RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)), 
g_regex_replace, errthrow)
+  _WRAP_METHOD(Glib::ustring replace(const gchar* string, gssize string_len, int start_position, const 
Glib::ustring& replacement, RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)), 
g_regex_replace, errthrow "Glib::RegexError", errthrow)
+  /// @throws Glib::RegexError
   Glib::ustring replace(const Glib::ustring& string, int start_position, const Glib::ustring& replacement, 
RegexMatchFlags match_options);
 
-  _WRAP_METHOD(Glib::ustring replace_literal(const gchar *string, gssize string_len, int start_position, 
const Glib::ustring& replacement, RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)), 
g_regex_replace_literal, errthrow)
+  _WRAP_METHOD(Glib::ustring replace_literal(const gchar *string, gssize string_len, int start_position, 
const Glib::ustring& replacement, RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)), 
g_regex_replace_literal, errthrow "Glib::RegexError", errthrow)
+  /// @throws Glib::RegexError
   Glib::ustring replace_literal(const Glib::ustring& string, int start_position, const Glib::ustring& 
replacement, RegexMatchFlags match_options);
 
-  _WRAP_METHOD(Glib::ustring replace_eval(const Glib::ustring& string, gssize string_len, int 
start_position, RegexMatchFlags match_options, GRegexEvalCallback eval,  gpointer user_data), 
g_regex_replace_eval, errthrow)
-  _WRAP_METHOD(static bool check_replacement(const Glib::ustring& replacement, gboolean* has_references), 
g_regex_check_replacement, errthrow)
+  _WRAP_METHOD(Glib::ustring replace_eval(const Glib::ustring& string, gssize string_len, int 
start_position, RegexMatchFlags match_options, GRegexEvalCallback eval,  gpointer user_data), 
g_regex_replace_eval, errthrow "Glib::RegexError", errthrow)
+  _WRAP_METHOD(static bool check_replacement(const Glib::ustring& replacement, gboolean* has_references), 
g_regex_check_replacement, errthrow "Glib::RegexError", errthrow)
 };
 
 //TODO: Add C++ iterator like functionality for this class.
@@ -255,12 +265,12 @@ public:
   _WRAP_METHOD(Glib::ustring get_string() const, g_match_info_get_string)
   _WRAP_METHOD(bool matches() const, g_match_info_matches)
 
-  _WRAP_METHOD(bool next(), g_match_info_next, errthrow)
+  _WRAP_METHOD(bool next(), g_match_info_next, errthrow "Glib::RegexError", errthrow)
 
   _WRAP_METHOD(int get_match_count() const, g_match_info_get_match_count)
   _WRAP_METHOD(bool is_partial_match() const, g_match_info_is_partial_match)
 
-  _WRAP_METHOD(Glib::ustring expand_references(const Glib::ustring& string_to_expand), 
g_match_info_expand_references, errthrow)
+  _WRAP_METHOD(Glib::ustring expand_references(const Glib::ustring& string_to_expand), 
g_match_info_expand_references, errthrow "Glib::RegexError", errthrow)
 
   _WRAP_METHOD(Glib::ustring fetch(int match_num), g_match_info_fetch)
 


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