From fee2cdb972482cb3682e83a72954d31c6ec6fcdc Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Thu, 3 Feb 2011 22:40:17 +0100 Subject: [PATCH] OString: New method isEmpty() --- sal/inc/rtl/string.hxx | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx index 86bc1a6..c1af815 100644 --- a/sal/inc/rtl/string.hxx +++ b/sal/inc/rtl/string.hxx @@ -223,6 +223,22 @@ public: sal_Int32 getLength() const SAL_THROW(()) { return pData->length; } /** + Checks if a string is empty. + + @return sal_True if the string is empty; + sal_False, otherwise. + + @since LibreOffice 3.4 + */ + sal_Bool isEmpty() const SAL_THROW(()) + { + if ( pData->length ) + return sal_False; + else + return sal_True; + } + + /** Returns a pointer to the characters of this string.

The returned pointer is not guaranteed to point to a null-terminated -- 1.7.3.5