diff options
author | Daniel Elstner <daniel@src.gnome.org> | 2009-01-08 15:36:16 +0000 |
---|---|---|
committer | Daniel Elstner <daniel@src.gnome.org> | 2009-01-08 15:36:16 +0000 |
commit | 312625c59865b9728b1fefb237067cf738933ebd (patch) | |
tree | 8d2f2b02bbce2fe7a2843fda3d8b512e3c6313aa /glib/glibmm | |
parent | 278f9436119c1f97e953ba02513f4797d8931c9d (diff) | |
download | glibmm-312625c59865b9728b1fefb237067cf738933ebd.tar.gz |
:compose): Add an overload which takes only a format string and no
* 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.
svn path=/trunk/; revision=773
Diffstat (limited to 'glib/glibmm')
-rw-r--r-- | glib/glibmm/ustring.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/glib/glibmm/ustring.h b/glib/glibmm/ustring.h index 48782254..10ef2983 100644 --- a/glib/glibmm/ustring.h +++ b/glib/glibmm/ustring.h @@ -608,6 +608,13 @@ public: //! @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 @@ public: 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); |