glibmm r773 - in trunk: . glib/glibmm



Author: daniel
Date: Thu Jan  8 15:36:16 2009
New Revision: 773
URL: http://svn.gnome.org/viewvc/glibmm?rev=773&view=rev

Log:
* glib/glibmm/ustring.h (ustring::compose): Add an overload which
takes only a format string and no arguments to be substituted.  It
is essentially a null-operation as long as the format string does
not contain any invalid argument references.  Bug #506394.

Modified:
   trunk/ChangeLog
   trunk/glib/glibmm/ustring.h

Modified: trunk/glib/glibmm/ustring.h
==============================================================================
--- trunk/glib/glibmm/ustring.h	(original)
+++ trunk/glib/glibmm/ustring.h	Thu Jan  8 15:36:16 2009
@@ -608,6 +608,13 @@
 //! @name Message formatting.
 //! @{
 
+  /* Returns fmt as is, but checks for invalid references in the format string.
+   * @newin2p18
+   */
+  template <class T1>
+  static inline
+  ustring compose(const ustring& fmt);
+
   /*! Substitute placeholders in a format string with the referenced arguments.
    * The template string should be in <tt>qt-format</tt>, that is
    * <tt>"%1"</tt>, <tt>"%2"</tt>, ..., <tt>"%9"</tt> are used as placeholders
@@ -1302,6 +1309,13 @@
 
 template <class T1>
 inline // static
+ustring ustring::compose(const ustring& fmt)
+{
+  return ustring::compose_argv(fmt, 0, 0);
+}
+
+template <class T1>
+inline // static
 ustring ustring::compose(const ustring& fmt, const T1& a1)
 {
   const ustring::Stringify<T1> s1(a1);



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