[glibmm] Glib::KeyFile, OptionContext, Regex: Add exception specs to errthrow



commit 7f2b773de37fa67e9b74d7a3b2471da4a53cff22
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Fri Sep 29 15:33:14 2017 +0200

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

 glib/src/keyfile.hg       |   10 +++++-----
 glib/src/optioncontext.hg |    3 ++-
 glib/src/regex.hg         |   40 +++++++++++++++++++++++++---------------
 3 files changed, 32 insertions(+), 21 deletions(-)
---
diff --git a/glib/src/keyfile.hg b/glib/src/keyfile.hg
index 17852ca..584b9d3 100644
--- a/glib/src/keyfile.hg
+++ b/glib/src/keyfile.hg
@@ -142,7 +142,7 @@ public:
 
   _IGNORE(g_key_file_load_from_dirs)
 
-  _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 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
@@ -150,7 +150,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
@@ -166,7 +166,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")
 
   _WRAP_METHOD(Glib::ustring get_start_group() const, g_key_file_get_start_group)
 
@@ -233,7 +233,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")
 
   /** 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
@@ -246,7 +246,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")
 
   /** 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 27600af..914fdf1 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")
 
   /** 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 fdc7a42..68bca08 100644
--- a/glib/src/regex.hg
+++ b/glib/src/regex.hg
@@ -99,6 +99,7 @@ public:
   _WRAP_ENUM(CompileFlags, GRegexCompileFlags, NO_GTYPE)
   _WRAP_ENUM(MatchFlags, GRegexMatchFlags, NO_GTYPE)
 
+  /// @throws Glib::RegexError
   static Glib::RefPtr<Glib::Regex> create(const Glib::ustring& pattern, CompileFlags compile_options = 
static_cast<CompileFlags>(0), MatchFlags match_options = static_cast<MatchFlags>(0));
 
   _WRAP_METHOD(Glib::ustring get_pattern() const, g_regex_get_pattern)
@@ -124,7 +125,9 @@ public:
   /// A match() method not requiring a Glib::MatchInfo.
   bool match(const Glib::ustring& string, MatchFlags match_options = static_cast<MatchFlags>(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,
@@ -132,7 +135,7 @@ public:
     MatchFlags match_options = static_cast<MatchFlags>(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,
@@ -141,7 +144,9 @@ public:
     MatchFlags match_options = static_cast<MatchFlags>(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, MatchFlags match_options);
 
   /** A match() method with a string length and start position not requiring a
@@ -159,7 +164,9 @@ public:
   /// A match_all() method not requiring a Glib::MatchInfo.
   bool match_all(const Glib::ustring& string, MatchFlags match_options = static_cast<MatchFlags>(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,
@@ -167,8 +174,7 @@ public:
     MatchFlags match_options = static_cast<MatchFlags>(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,
@@ -177,13 +183,14 @@ public:
     MatchFlags match_options = static_cast<MatchFlags>(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, MatchFlags 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, MatchFlags 
match_options);
 
@@ -191,18 +198,21 @@ public:
   _WRAP_METHOD(static std::vector<Glib::ustring> split_simple(const Glib::ustring& pattern, const 
Glib::ustring& string, CompileFlags compile_options = static_cast<CompileFlags>(0), MatchFlags match_options 
= static_cast<MatchFlags>(0)), g_regex_split_simple)
   _WRAP_METHOD(std::vector<Glib::ustring> split(const Glib::ustring& string, MatchFlags match_options = 
static_cast<MatchFlags>(0)), g_regex_split)
 
-  _WRAP_METHOD(std::vector<Glib::ustring> split(const gchar* string, gssize string_len, int start_position, 
MatchFlags match_options = static_cast<MatchFlags>(0), int max_tokens = 0) const, g_regex_split_full, 
errthrow)
+  _WRAP_METHOD(std::vector<Glib::ustring> split(const gchar* string, gssize string_len, int start_position, 
MatchFlags match_options = static_cast<MatchFlags>(0), int max_tokens = 0) const, g_regex_split_full, 
errthrow "Glib::RegexError")
 
+  /// @throws Glib::RegexError
   std::vector<Glib::ustring> split(const Glib::ustring& string, int start_position, MatchFlags 
match_options, int max_tokens) const;
 
-  _WRAP_METHOD(Glib::ustring replace(const gchar* string, gssize string_len, int start_position, const 
Glib::ustring& replacement, MatchFlags match_options = static_cast<MatchFlags>(0)), g_regex_replace, errthrow)
+  _WRAP_METHOD(Glib::ustring replace(const gchar* string, gssize string_len, int start_position, const 
Glib::ustring& replacement, MatchFlags match_options = static_cast<MatchFlags>(0)), g_regex_replace, errthrow 
"Glib::RegexError")
+  /// @throws Glib::RegexError
   Glib::ustring replace(const Glib::ustring& string, int start_position, const Glib::ustring& replacement, 
MatchFlags match_options);
 
-  _WRAP_METHOD(Glib::ustring replace_literal(const gchar *string, gssize string_len, int start_position, 
const Glib::ustring& replacement, MatchFlags match_options = static_cast<MatchFlags>(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, MatchFlags match_options = static_cast<MatchFlags>(0)), 
g_regex_replace_literal, errthrow "Glib::RegexError")
+  /// @throws Glib::RegexError
   Glib::ustring replace_literal(const Glib::ustring& string, int start_position, const Glib::ustring& 
replacement, MatchFlags match_options);
 
-  _WRAP_METHOD(Glib::ustring replace_eval(const Glib::ustring& string, gssize string_len, int 
start_position, MatchFlags 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, MatchFlags match_options, GRegexEvalCallback eval,  gpointer user_data), 
g_regex_replace_eval, errthrow "Glib::RegexError")
+  _WRAP_METHOD(static bool check_replacement(const Glib::ustring& replacement, gboolean* has_references), 
g_regex_check_replacement, errthrow "Glib::RegexError")
 };
 
 //TODO: Add C++ iterator like functionality for this class.
@@ -254,12 +264,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")
 
   _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")
 
   _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]