Kaydet (Commit) acc9fb5c authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Prevent misuses of RTL_CONSTASCII_USTRINGPARAM

works only on 64 bit platforms, though.
üst a5661d71
...@@ -495,6 +495,14 @@ public: ...@@ -495,6 +495,14 @@ public:
str, strLength, strLength) == 0; str, strLength, strLength) == 0;
} }
// This overload is left undefined, to detect calls of matchL that
// erroneously use RTL_CONSTASCII_USTRINGPARAM instead of
// RTL_CONSTASCII_STRINGPARAM (but would lead to ambiguities on 32 bit
// platforms):
#if SAL_TYPES_SIZEOFLONG == 8
void matchL(char const *, sal_Int32, rtl_TextEncoding) const;
#endif
/** /**
Match against a substring appearing in this string, ignoring the case of Match against a substring appearing in this string, ignoring the case of
ASCII letters. ASCII letters.
...@@ -686,6 +694,14 @@ public: ...@@ -686,6 +694,14 @@ public:
return n < 0 ? n : n + fromIndex; return n < 0 ? n : n + fromIndex;
} }
// This overload is left undefined, to detect calls of indexOfL that
// erroneously use RTL_CONSTASCII_USTRINGPARAM instead of
// RTL_CONSTASCII_STRINGPARAM (but would lead to ambiguities on 32 bit
// platforms):
#if SAL_TYPES_SIZEOFLONG == 8
void indexOfL(char const *, sal_Int32, rtl_TextEncoding) const;
#endif
/** /**
Returns the index within this string of the last occurrence of Returns the index within this string of the last occurrence of
the specified substring, searching backward starting at the end. the specified substring, searching backward starting at the end.
......
...@@ -681,6 +681,14 @@ public: ...@@ -681,6 +681,14 @@ public:
asciiStr, asciiStrLength ) == 0; asciiStr, asciiStrLength ) == 0;
} }
// This overload is left undefined, to detect calls of matchAsciiL that
// erroneously use RTL_CONSTASCII_USTRINGPARAM instead of
// RTL_CONSTASCII_STRINGPARAM (but would lead to ambiguities on 32 bit
// platforms):
#if SAL_TYPES_SIZEOFLONG == 8
void matchAsciiL(char const *, sal_Int32, rtl_TextEncoding) const;
#endif
/** /**
Match against a substring appearing in this string, ignoring the case of Match against a substring appearing in this string, ignoring the case of
ASCII letters. ASCII letters.
...@@ -711,6 +719,15 @@ public: ...@@ -711,6 +719,15 @@ public:
asciiStr, asciiStrLength ) == 0; asciiStr, asciiStrLength ) == 0;
} }
// This overload is left undefined, to detect calls of
// matchIgnoreAsciiCaseAsciiL that erroneously use
// RTL_CONSTASCII_USTRINGPARAM instead of RTL_CONSTASCII_STRINGPARAM (but
// would lead to ambiguities on 32 bit platforms):
#if SAL_TYPES_SIZEOFLONG == 8
void matchIgnoreAsciiCaseAsciiL(char const *, sal_Int32, rtl_TextEncoding)
const;
#endif
/** /**
Check whether this string ends with a given substring. Check whether this string ends with a given substring.
...@@ -905,6 +922,14 @@ public: ...@@ -905,6 +922,14 @@ public:
return ret < 0 ? ret : ret + fromIndex; return ret < 0 ? ret : ret + fromIndex;
} }
// This overload is left undefined, to detect calls of indexOfAsciiL that
// erroneously use RTL_CONSTASCII_USTRINGPARAM instead of
// RTL_CONSTASCII_STRINGPARAM (but would lead to ambiguities on 32 bit
// platforms):
#if SAL_TYPES_SIZEOFLONG == 8
void indexOfAsciiL(char const *, sal_Int32 len, rtl_TextEncoding) const;
#endif
/** /**
Returns the index within this string of the last occurrence of Returns the index within this string of the last occurrence of
the specified substring, searching backward starting at the end. the specified substring, searching backward starting at the end.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment