summaryrefslogtreecommitdiff
path: root/include/rtl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-12-19 12:01:42 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-12-19 14:28:14 +0100
commit240f9bcb70b0781a4aec42550cbccd95f528d8d7 (patch)
tree271074828a2e5203c275abbd6ef704169a8b44e1 /include/rtl
parentd5c86be04ee4ab4dba14bc70adc91bf5888dc31c (diff)
No need for RTL_FAST_STRING in addition to LIBO_INTERNAL_ONLY
Change-Id: I5514898f588b21bafceefca95e3276826cb9a882
Diffstat (limited to 'include/rtl')
-rw-r--r--include/rtl/strbuf.hxx25
-rw-r--r--include/rtl/string.hxx17
-rw-r--r--include/rtl/stringconcat.hxx2
-rw-r--r--include/rtl/stringutils.hxx6
-rw-r--r--include/rtl/ustrbuf.hxx25
-rw-r--r--include/rtl/ustring.hxx31
6 files changed, 27 insertions, 79 deletions
diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx
index 22aa20b0534d..6a21c573ca5a 100644
--- a/include/rtl/strbuf.hxx
+++ b/include/rtl/strbuf.hxx
@@ -29,7 +29,7 @@
#include <rtl/string.hxx>
#include <rtl/stringutils.hxx>
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
#include <rtl/stringconcat.hxx>
#endif
@@ -214,7 +214,7 @@ public:
rtl_stringbuffer_newFromStr_WithLength( &pData, value, length );
}
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@overload
@internal
@@ -495,7 +495,7 @@ public:
return *this;
}
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@overload
@internal
@@ -940,21 +940,6 @@ public:
return *this;
}
-#ifdef LIBO_INTERNAL_ONLY
- // This is to complement the RTL_FAST_STRING operator+, which allows any combination of valid operands,
- // even two buffers. It's intentional it returns OString, just like the operator+ would in the fast variant.
-#ifndef RTL_FAST_STRING
- /**
- @internal
- @since LibreOffice 4.1
- */
- friend OString operator+( const OStringBuffer& str1, const OStringBuffer& str2 )
- {
- return OString( str1.pData ).concat( str2.pData );
- }
-#endif
-#endif
-
private:
/**
A pointer to the data structure which contains the data.
@@ -967,7 +952,7 @@ private:
sal_Int32 nCapacity;
};
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@internal
*/
@@ -992,7 +977,7 @@ typedef rtlunittest::OStringBuffer OStringBuffer;
#undef RTL_STRING_CONST_FUNCTION
#endif
-#ifdef LIBO_INTERNAL_ONLY
+#if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
using ::rtl::OStringBuffer;
#endif
diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx
index d11b18be0a7a..35716250dfb6 100644
--- a/include/rtl/string.hxx
+++ b/include/rtl/string.hxx
@@ -31,7 +31,7 @@
#include <rtl/string.h>
#include <rtl/stringutils.hxx>
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
#include <rtl/stringconcat.hxx>
#endif
@@ -231,7 +231,7 @@ public:
}
}
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@overload
@internal
@@ -297,7 +297,7 @@ public:
return *this;
}
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@overload
@internal
@@ -1128,7 +1128,7 @@ public:
return OString( pNew, SAL_NO_ACQUIRE );
}
-#ifndef RTL_FAST_STRING
+#ifndef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
friend OString operator+( const OString & str1, const OString & str2 )
{
return str1.concat( str2 );
@@ -1634,7 +1634,7 @@ public:
/* ======================================================================= */
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
A simple wrapper around string literal. It is usually not necessary to use, can
be mostly used to force OString operator+ working with operands that otherwise would
@@ -1684,11 +1684,6 @@ inline std::basic_ostream<charT, traits> & operator <<(
{
return stream << OString( concat );
}
-#else
-// non-RTL_FAST_STRING needs this to compile
-/// @cond INTERNAL
-typedef OString OStringLiteral;
-/// @endcond
#endif
@@ -1752,7 +1747,7 @@ typedef rtlunittest::OString OString;
#undef RTL_STRING_CONST_FUNCTION
#endif
-#ifdef LIBO_INTERNAL_ONLY
+#if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
using ::rtl::OString;
using ::rtl::OStringHash;
using ::rtl::OStringLiteral;
diff --git a/include/rtl/stringconcat.hxx b/include/rtl/stringconcat.hxx
index 089948cb298f..a74dd77ad78c 100644
--- a/include/rtl/stringconcat.hxx
+++ b/include/rtl/stringconcat.hxx
@@ -14,7 +14,7 @@
#include <string.h>
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
#ifdef RTL_STRING_UNITTEST
#define rtl rtlunittest
diff --git a/include/rtl/stringutils.hxx b/include/rtl/stringutils.hxx
index 1f1e53bcdacc..fb11545569e4 100644
--- a/include/rtl/stringutils.hxx
+++ b/include/rtl/stringutils.hxx
@@ -13,12 +13,6 @@
#include <sal/config.h>
#include <sal/types.h>
-// This feature is not part of public API and is meant to be used only internally by LibreOffice.
-#ifdef LIBO_INTERNAL_ONLY
-// Enable fast string concatenation.
-#define RTL_FAST_STRING
-#endif
-
// The unittest uses slightly different code to help check that the proper
// calls are made. The class is put into a different namespace to make
// sure the compiler generates a different (if generating also non-inline)
diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx
index 2cefab86b4dc..4c8243f828cb 100644
--- a/include/rtl/ustrbuf.hxx
+++ b/include/rtl/ustrbuf.hxx
@@ -30,7 +30,7 @@
#include <rtl/stringutils.hxx>
#include <sal/types.h>
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
#include <rtl/stringconcat.hxx>
#endif
@@ -184,7 +184,7 @@ public:
}
#endif
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@overload
@internal
@@ -493,7 +493,7 @@ public:
return *this;
}
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@overload
@internal
@@ -1395,21 +1395,6 @@ public:
return OUStringBuffer( pNew, count + 16 );
}
-#ifdef LIBO_INTERNAL_ONLY
- // This is to complement the RTL_FAST_STRING operator+, which allows any combination of valid operands,
- // even two buffers. It's intentional it returns OUString, just like the operator+ would in the fast variant.
-#ifndef RTL_FAST_STRING
- /**
- @internal
- @since LibreOffice 4.1
- */
- friend OUString operator+( const OUStringBuffer& str1, const OUStringBuffer& str2 )
- {
- return OUString( str1.pData ).concat( str2.pData );
- }
-#endif
-#endif
-
private:
OUStringBuffer( rtl_uString * value, const sal_Int32 capacity )
{
@@ -1428,7 +1413,7 @@ private:
sal_Int32 nCapacity;
};
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@internal
*/
@@ -1451,7 +1436,7 @@ typedef rtlunittest::OUStringBuffer OUStringBuffer;
}
#endif
-#ifdef LIBO_INTERNAL_ONLY
+#if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
using ::rtl::OUStringBuffer;
#endif
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index 1dab50f811bd..2202415c6635 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -33,7 +33,7 @@
#include <rtl/textenc.h>
#include <sal/log.hxx>
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
#include <rtl/stringconcat.hxx>
#endif
@@ -53,7 +53,7 @@ namespace rtl
#undef rtl
#endif
-#if defined RTL_FAST_STRING
+#if defined LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/// @cond INTERNAL
/**
@@ -250,7 +250,7 @@ public:
}
#endif
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/// @cond INTERNAL
/**
New string from an 8-Bit string literal that is expected to contain only
@@ -324,7 +324,7 @@ public:
}
}
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@overload
@internal
@@ -400,7 +400,7 @@ public:
return *this;
}
-#if defined RTL_FAST_STRING
+#if defined LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/// @cond INTERNAL
/** Assign a new string from a single ASCII character literal.
@@ -425,7 +425,7 @@ public:
return *this;
}
-#ifdef RTL_FAST_STRING
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@overload
@internal
@@ -1575,7 +1575,7 @@ public:
return OUString( pNew, SAL_NO_ACQUIRE );
}
-#ifndef RTL_FAST_STRING
+#ifndef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
friend OUString operator+( const OUString& rStr1, const OUString& rStr2 )
{
return rStr1.concat( rStr2 );
@@ -2413,7 +2413,7 @@ public:
}
};
-#if defined RTL_FAST_STRING
+#if defined LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/// @cond INTERNAL
/** Compare a string and an ASCII character literal for equality.
@@ -2436,12 +2436,6 @@ template<char C> bool operator !=(
return !(string == literal);
}
-/// @endcond
-#endif
-
-/* ======================================================================= */
-
-#ifdef RTL_FAST_STRING
/**
@internal
*/
@@ -2487,10 +2481,7 @@ inline std::basic_ostream<charT, traits> & operator <<(
{
return stream << OUString( concat );
}
-#else
-// non-RTL_FAST_STRING needs this to compile
-/// @cond INTERNAL
-typedef OUString OUStringLiteral;
+
/// @endcond
#endif
@@ -2596,16 +2587,14 @@ typedef rtlunittest::OUString OUString;
// In internal code, allow to use classes like OUString without having to
// explicitly refer to the rtl namespace, which is kind of superfluous given
// that OUString itself is namespaced by its OU prefix:
-#ifdef LIBO_INTERNAL_ONLY
+#if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
using ::rtl::OUString;
using ::rtl::OUStringHash;
using ::rtl::OStringToOUString;
using ::rtl::OUStringToOString;
using ::rtl::OUStringLiteral;
-#if defined RTL_FAST_STRING
using ::rtl::OUStringLiteral1;
#endif
-#endif
#endif /* _RTL_USTRING_HXX */