summaryrefslogtreecommitdiff
path: root/include/rtl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-05-18 14:23:15 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-05-18 16:10:41 +0200
commiteca89ece45ede76605a6102c94b3b67e1f8ff5aa (patch)
tree13973d98d4cbcf324fddec118da696202b9b5cd9 /include/rtl
parent2f9d909a01f90197c3029a446f8aac8135f53f48 (diff)
Replace rtl_string_getTokenView with o3tl::getToken
...to not needlessly extend the sal ABI. At least for now, o3tl::getToken has a simpler interface than its OString::getToken counterpart (driven mainly by how it is used for now): it does not support a `token` argument, and its `position` argument must not be npos. To meet the latter requirement, the check for "subpath" in LineParser::readPath has been reworked slightly. Change-Id: I4428fe2d9aa03ca83a436fc6493fbc34665a8033 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115742 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/rtl')
-rw-r--r--include/rtl/string.h39
-rw-r--r--include/rtl/string.hxx9
2 files changed, 0 insertions, 48 deletions
diff --git a/include/rtl/string.h b/include/rtl/string.h
index c86468c7f302..d29caf93a718 100644
--- a/include/rtl/string.h
+++ b/include/rtl/string.h
@@ -1309,45 +1309,6 @@ SAL_DLLPUBLIC void SAL_CALL rtl_string_newTrim(
SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_string_getToken(
rtl_String ** newStr , rtl_String * str, sal_Int32 token, char cTok, sal_Int32 idx ) SAL_THROW_EXTERN_C();
-/** @cond INTERNAL */
-/** Create a new string by extracting a single token from another string.
-
- Starting at index, the next token is searched for. If there is no
- such token, the result is an empty string. Otherwise, all characters from
- the start of that token and up to, but not including the next occurrence
- of cTok make up the resulting token. The return value is the position of
- the next token, or -1 if no more tokens follow.
-
- This function does not handle out-of-memory conditions.
-
- @param ppViewStr
- pointer to the start of the token.
-
- @param pViewLength
- length of the token.
-
- @param str
- a valid string.
-
- @param token
- the number of the token to return, starting at index.
-
- @param cTok
- the character that separates the tokens.
-
- @param idx
- the position at which searching for the token starts. Must not be greater
- than the length of str.
-
- @return
- the index of the next token, or -1 if no more tokens follow.
-
- @since LibreOffice 7.2
- */
-SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_string_getTokenView(
- const char ** ppViewStr , sal_Int32* pViewLength, rtl_String * str, sal_Int32 token, char cTok, sal_Int32 idx ) SAL_THROW_EXTERN_C();
-/** @endcond */
-
/* ======================================================================= */
/** Supply an ASCII string literal together with its length.
diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx
index 3fc461de0c2c..f80dd7410da7 100644
--- a/include/rtl/string.hxx
+++ b/include/rtl/string.hxx
@@ -1765,15 +1765,6 @@ public:
index = rtl_string_getToken( &pNew, pData, token, cTok, index );
return OString( pNew, SAL_NO_ACQUIRE );
}
-#ifdef LIBO_INTERNAL_ONLY
- std::string_view getTokenView( sal_Int32 token, char cTok, sal_Int32& index ) const
- {
- const char* pViewData = nullptr;
- sal_Int32 nViewLength = 0;
- index = rtl_string_getTokenView( &pViewData, &nViewLength, pData, token, cTok, index );
- return std::string_view(pViewData, nViewLength);
- }
-#endif
/**
Returns a token from the string.