Remove now unused PBD::string_is_affirmative function
authorTim Mayberry <mojofunk@gmail.com>
Wed, 31 Aug 2016 05:38:55 +0000 (15:38 +1000)
committerTim Mayberry <mojofunk@gmail.com>
Tue, 18 Apr 2017 23:36:59 +0000 (09:36 +1000)
The equivalent function is now PBD::string_to<bool>

libs/pbd/convert.cc
libs/pbd/pbd/convert.h

index dd43475e6973583cc147feadc749be218afba673..c9af72750434e32dec7a4874d479cd4fe6545b1e 100644 (file)
@@ -278,26 +278,6 @@ strings_equal_ignore_case (const string& a, const string& b)
        return false;
 }
 
-bool
-string_is_affirmative (const std::string& str)
-{
-       /* to be used only with XML data - not intended to handle user input */
-
-       if (str.empty ()) {
-               return false;
-       }
-
-       /* the use of g_ascii_strncasecmp() is solely to get around issues with
-        * charsets posed by trying to use C++ for the same
-        * comparison. switching a std::string to its lower- or upper-case
-        * version has several issues, but handled by default
-        * in the way we desire when doing it in C.
-        */
-
-       return str == "1" || str == "y" || str == "Y" || (!g_ascii_strncasecmp(str.c_str(), "yes", str.length())) ||
-               (!g_ascii_strncasecmp(str.c_str(), "true", str.length()));
-}
-
 /** A wrapper for dgettext that takes a msgid of the form Context|Text.
  *  If Context|Text is translated, the translation is returned, otherwise
  *  just Text is returned.  Useful for getting translations of words or phrases
index d638ab8c8d5080fedcd0df6f58ca4ded2cb32816..af40446a81715d5482297021ce87efe77dabb90c 100644 (file)
@@ -57,8 +57,6 @@ to_string (T t, std::ios_base & (*f)(std::ios_base&))
        return oss.str();
 }
 
-LIBPBD_API bool string_is_affirmative (const std::string&);
-
 LIBPBD_API const char* sgettext (const char *, const char *);
 
 } //namespace PBD