summaryrefslogtreecommitdiff
path: root/sal/inc
diff options
context:
space:
mode:
Diffstat (limited to 'sal/inc')
-rw-r--r--sal/inc/rtl/string.hxx35
1 files changed, 35 insertions, 0 deletions
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 79b9a15ae94a..d899067754b4 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -57,6 +57,12 @@ namespace rtl
#ifdef RTL_STRING_UNITTEST
#undef rtl
+// helper macros to make functions appear more readable
+#define RTL_STRING_CONST_FUNCTION rtl_string_unittest_const_literal_function = true;
+#define RTL_STRING_NON_CONST_FUNCTION rtl_string_unittest_non_const_literal_function = true;
+#else
+#define RTL_STRING_CONST_FUNCTION
+#define RTL_STRING_NON_CONST_FUNCTION
#endif
/* ======================================================================= */
@@ -209,6 +215,7 @@ public:
If there are any embedded \0's in the string literal, the result is undefined.
Use the overload that explicitly accepts length.
+ @since LibreOffice 3.6
@param literal a string literal
*/
@@ -225,6 +232,7 @@ public:
/**
@overload
New string from a non-const char array.
+ @since LibreOffice 3.6
@param value non-const char array
*/
@@ -299,6 +307,33 @@ public:
}
/**
+ @overload
+ This function accepts an ASCII string literal as its argument.
+ @since LibreOffice 3.6
+ */
+ template< int N >
+ OString& operator=( const char (&literal)[ N ] ) SAL_THROW(())
+ {
+ rtl_string_newFromLiteral( &pData, literal, N - 1 );
+ RTL_STRING_CONST_FUNCTION
+ return *this;
+ }
+ /**
+ @overload
+ This function accepts a non-const char array as its argument.
+ @since LibreOffice 3.6
+
+ @param value non-const char array
+ */
+ template< int N >
+ OString& operator=( char (&value)[ N ] ) SAL_THROW(())
+ {
+ rtl_string_newFromStr( &pData, value );
+ RTL_STRING_NON_CONST_FUNCTION
+ return *this;
+ }
+
+ /**
Append a string to this string.
@param str a OString.
>Noel Grandin 2014-08-08java: remove redundant super-interfacesNoel Grandin 2014-08-08java: remove dead methodsNoel Grandin 2014-08-05java: remove commented out codeNoel Grandin 2014-08-05java: remove unused fieldsNoel Grandin 2014-08-05java: remove various unused variablesNoel Grandin 2014-08-04java: remove pre Java 1.5 workaround in UrlToFileMapperNoel Grandin 2014-08-04java: remove workarounds for missing functionality pre java 1.5Noel Grandin 2014-08-04simplify some java static initializersNoel Grandin 2014-07-27jurt: Enhanced For-Loopsrbuj 2014-07-24typosMichael Stahl 2014-07-24jurt: Enhanced For-Loops, code formatting, javadoc & overridesrbuj 2014-07-23TyposJulien Nabet 2014-06-04coverity#705190 Missing break in switchCaolán McNamara 2014-05-16idl: remove external header guardsThomas Arnhold 2014-04-30Many spelling fixes: directories h* - p*.Pedro Giffuni