diff options
Diffstat (limited to 'include/rtl/string.hxx')
-rw-r--r-- | include/rtl/string.hxx | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx index ad143f5ae047..ca0d1d114053 100644 --- a/include/rtl/string.hxx +++ b/include/rtl/string.hxx @@ -99,7 +99,7 @@ public: */ OString() { - pData = 0; + pData = NULL; rtl_string_new( &pData ); } @@ -143,7 +143,7 @@ public: @param value a character. */ explicit OString( sal_Char value ) - : pData (0) + : pData (NULL) { rtl_string_newFromStr_WithLength( &pData, &value, 1 ); } @@ -159,14 +159,14 @@ public: template< typename T > OString( const T& value, typename libreoffice_internal::CharPtrDetector< T, libreoffice_internal::Dummy >::Type = libreoffice_internal::Dummy() ) { - pData = 0; + pData = NULL; rtl_string_newFromStr( &pData, value ); } template< typename T > OString( T& value, typename libreoffice_internal::NonConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type = libreoffice_internal::Dummy() ) { - pData = 0; + pData = NULL; rtl_string_newFromStr( &pData, value ); } @@ -185,7 +185,7 @@ public: { assert( libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal)); - pData = 0; + pData = NULL; if (libreoffice_internal::ConstCharArrayDetector<T>::length == 0) { rtl_string_new(&pData); } else { @@ -210,7 +210,7 @@ public: */ OString( const sal_Char * value, sal_Int32 length ) { - pData = 0; + pData = NULL; rtl_string_newFromStr_WithLength( &pData, value, length ); } @@ -232,9 +232,9 @@ public: rtl_TextEncoding encoding, sal_uInt32 convertFlags = OUSTRING_TO_OSTRING_CVTFLAGS ) { - pData = 0; + pData = NULL; rtl_uString2String( &pData, value, length, encoding, convertFlags ); - if (pData == 0) { + if (pData == NULL) { throw std::bad_alloc(); } } @@ -750,9 +750,9 @@ public: @since LibreOffice 4.0 */ - bool startsWith(OString const & str, OString * rest = 0) const { + bool startsWith(OString const & str, OString * rest = NULL) const { bool b = match(str); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy(str.getLength()); } return b; @@ -765,11 +765,11 @@ public: */ template< typename T > typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type startsWith( - T & literal, OString * rest = 0) const + T & literal, OString * rest = NULL) const { RTL_STRING_CONST_FUNCTION bool b = match(literal, 0); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy( libreoffice_internal::ConstCharArrayDetector<T>::length); } @@ -795,11 +795,11 @@ public: @since LibreOffice 5.1 */ - bool startsWithIgnoreAsciiCase(OString const & str, OString * rest = 0) + bool startsWithIgnoreAsciiCase(OString const & str, OString * rest = NULL) const { bool b = matchIgnoreAsciiCase(str); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy(str.getLength()); } return b; @@ -812,13 +812,13 @@ public: */ template< typename T > typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type - startsWithIgnoreAsciiCase(T & literal, OString * rest = 0) const + startsWithIgnoreAsciiCase(T & literal, OString * rest = NULL) const { RTL_STRING_CONST_FUNCTION assert( libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal)); bool b = matchIgnoreAsciiCase(literal); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy( libreoffice_internal::ConstCharArrayDetector<T>::length); } @@ -839,10 +839,10 @@ public: @since LibreOffice 3.6 */ - bool endsWith(OString const & str, OString * rest = 0) const { + bool endsWith(OString const & str, OString * rest = NULL) const { bool b = str.getLength() <= getLength() && match(str, getLength() - str.getLength()); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy(0, getLength() - str.getLength()); } return b; @@ -855,7 +855,7 @@ public: */ template< typename T > typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type endsWith( - T & literal, OString * rest = 0) const + T & literal, OString * rest = NULL) const { RTL_STRING_CONST_FUNCTION assert( @@ -868,7 +868,7 @@ public: literal), (getLength() - libreoffice_internal::ConstCharArrayDetector<T>::length)); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy( 0, (getLength() @@ -1214,7 +1214,7 @@ public: */ SAL_WARN_UNUSED_RESULT OString copy( sal_Int32 beginIndex ) const { - rtl_String *pNew = 0; + rtl_String *pNew = NULL; rtl_string_newFromSubString( &pNew, pData, beginIndex, getLength() - beginIndex ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1233,7 +1233,7 @@ public: */ SAL_WARN_UNUSED_RESULT OString copy( sal_Int32 beginIndex, sal_Int32 count ) const { - rtl_String *pNew = 0; + rtl_String *pNew = NULL; rtl_string_newFromSubString( &pNew, pData, beginIndex, count ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1248,7 +1248,7 @@ public: */ SAL_WARN_UNUSED_RESULT OString concat( const OString & str ) const { - rtl_String* pNew = 0; + rtl_String* pNew = NULL; rtl_string_newConcat( &pNew, pData, str.pData ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1275,7 +1275,7 @@ public: */ SAL_WARN_UNUSED_RESULT OString replaceAt( sal_Int32 index, sal_Int32 count, const OString& newStr ) const { - rtl_String* pNew = 0; + rtl_String* pNew = NULL; rtl_string_newReplaceStrAt( &pNew, pData, index, count, newStr.pData ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1295,7 +1295,7 @@ public: */ SAL_WARN_UNUSED_RESULT OString replace( sal_Char oldChar, sal_Char newChar ) const { - rtl_String* pNew = 0; + rtl_String* pNew = NULL; rtl_string_newReplace( &pNew, pData, oldChar, newChar ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1319,13 +1319,13 @@ public: @since LibreOffice 3.6 */ SAL_WARN_UNUSED_RESULT OString replaceFirst( - OString const & from, OString const & to, sal_Int32 * index = 0) const + OString const & from, OString const & to, sal_Int32 * index = NULL) const { - rtl_String * s = 0; + rtl_String * s = NULL; sal_Int32 i = 0; rtl_string_newReplaceFirst( &s, pData, from.pData->buffer, from.pData->length, - to.pData->buffer, to.pData->length, index == 0 ? &i : index); + to.pData->buffer, to.pData->length, index == NULL ? &i : index); return OString(s, SAL_NO_ACQUIRE); } @@ -1343,7 +1343,7 @@ public: @since LibreOffice 3.6 */ SAL_WARN_UNUSED_RESULT OString replaceAll(OString const & from, OString const & to) const { - rtl_String * s = 0; + rtl_String * s = NULL; rtl_string_newReplaceAll( &s, pData, from.pData->buffer, from.pData->length, to.pData->buffer, to.pData->length); @@ -1362,7 +1362,7 @@ public: */ SAL_WARN_UNUSED_RESULT OString toAsciiLowerCase() const { - rtl_String* pNew = 0; + rtl_String* pNew = NULL; rtl_string_newToAsciiLowerCase( &pNew, pData ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1379,7 +1379,7 @@ public: */ SAL_WARN_UNUSED_RESULT OString toAsciiUpperCase() const { - rtl_String* pNew = 0; + rtl_String* pNew = NULL; rtl_string_newToAsciiUpperCase( &pNew, pData ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1397,7 +1397,7 @@ public: */ SAL_WARN_UNUSED_RESULT OString trim() const { - rtl_String* pNew = 0; + rtl_String* pNew = NULL; rtl_string_newTrim( &pNew, pData ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1428,7 +1428,7 @@ public: */ OString getToken( sal_Int32 token, sal_Char cTok, sal_Int32& index ) const { - rtl_String * pNew = 0; + rtl_String * pNew = NULL; index = rtl_string_getToken( &pNew, pData, token, cTok, index ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1602,7 +1602,7 @@ public: static OString number( long long ll, sal_Int16 radix = 10 ) { sal_Char aBuf[RTL_STR_MAX_VALUEOFINT64]; - rtl_String* pNewData = 0; + rtl_String* pNewData = NULL; rtl_string_newFromStr_WithLength( &pNewData, aBuf, rtl_str_valueOfInt64( aBuf, ll, radix ) ); return OString( pNewData, SAL_NO_ACQUIRE ); } @@ -1611,7 +1611,7 @@ public: static OString number( unsigned long long ll, sal_Int16 radix = 10 ) { sal_Char aBuf[RTL_STR_MAX_VALUEOFUINT64]; - rtl_String* pNewData = 0; + rtl_String* pNewData = NULL; rtl_string_newFromStr_WithLength( &pNewData, aBuf, rtl_str_valueOfUInt64( aBuf, ll, radix ) ); return OString( pNewData, SAL_NO_ACQUIRE ); } @@ -1628,7 +1628,7 @@ public: static OString number( float f ) { sal_Char aBuf[RTL_STR_MAX_VALUEOFFLOAT]; - rtl_String* pNewData = 0; + rtl_String* pNewData = NULL; rtl_string_newFromStr_WithLength( &pNewData, aBuf, rtl_str_valueOfFloat( aBuf, f ) ); return OString( pNewData, SAL_NO_ACQUIRE ); } @@ -1645,7 +1645,7 @@ public: static OString number( double d ) { sal_Char aBuf[RTL_STR_MAX_VALUEOFDOUBLE]; - rtl_String* pNewData = 0; + rtl_String* pNewData = NULL; rtl_string_newFromStr_WithLength( &pNewData, aBuf, rtl_str_valueOfDouble( aBuf, d ) ); return OString( pNewData, SAL_NO_ACQUIRE ); } @@ -1680,7 +1680,7 @@ public: static OString boolean( bool b ) { sal_Char aBuf[RTL_STR_MAX_VALUEOFBOOLEAN]; - rtl_String* pNewData = 0; + rtl_String* pNewData = NULL; rtl_string_newFromStr_WithLength( &pNewData, aBuf, rtl_str_valueOfBoolean( aBuf, b ) ); return OString( pNewData, SAL_NO_ACQUIRE ); } |