diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-28 17:56:40 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-29 16:42:33 +0100 |
commit | 042033f1e6da22616cb76c8d950c20c9efecbad5 (patch) | |
tree | 26b3f1f42d067506f44550b410f3fb9640616a5b /l10ntools/inc | |
parent | ccfd8e9d09f9ac0a0ea92d0f378391006faaf934 (diff) |
loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'l10ntools/inc')
-rw-r--r-- | l10ntools/inc/common.hxx | 4 | ||||
-rw-r--r-- | l10ntools/inc/export.hxx | 11 | ||||
-rw-r--r-- | l10ntools/inc/helper.hxx | 5 | ||||
-rw-r--r-- | l10ntools/inc/helpmerge.hxx | 6 | ||||
-rw-r--r-- | l10ntools/inc/po.hxx | 10 | ||||
-rw-r--r-- | l10ntools/inc/xrmmerge.hxx | 4 |
6 files changed, 26 insertions, 14 deletions
diff --git a/l10ntools/inc/common.hxx b/l10ntools/inc/common.hxx index 993d5152967e..78bbbfdb83cc 100644 --- a/l10ntools/inc/common.hxx +++ b/l10ntools/inc/common.hxx @@ -15,6 +15,8 @@ #include <sal/config.h> #include <iostream> +#include <string_view> + #include <rtl/string.hxx> #include "po.hxx" @@ -48,7 +50,7 @@ void writeUsage(const OString& rName, const OString& rFileType); /// Write out a PoEntry with attention to exceptions void writePoEntry( const OString& rExecutable, PoOfstream& rPoStream, const OString& rSourceFile, - const OString& rResType, const OString& rGroupId, const OString& rLocalId, + std::string_view rResType, const OString& rGroupId, const OString& rLocalId, const OString& rHelpText, const OString& rText, const PoEntry::TYPE eType = PoEntry::TTEXT ); } diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx index 1ca56e4fe75d..183cecea2531 100644 --- a/l10ntools/inc/export.hxx +++ b/l10ntools/inc/export.hxx @@ -36,6 +36,7 @@ #include <vector> #include <queue> #include <string> +#include <string_view> #ifdef _WIN32 #include <direct.h> @@ -112,7 +113,7 @@ public: Generate QTZ string with ResData For executable which works one language and without PO files. */ - static OString GetQTZText(const ResData& rResData, const OString& rOrigText); + static OString GetQTZText(const ResData& rResData, std::string_view rOrigText); }; @@ -126,8 +127,8 @@ class MergeDataFile std::set<OString> aLanguageSet; MergeEntrys *GetMergeData( ResData *pResData , bool bCaseSensitive = false ); - void InsertEntry(const OString &rTYP, const OString &rGID, - const OString &rLID, const OString &nLang, + void InsertEntry(std::string_view rTYP, std::string_view rGID, + std::string_view rLID, const OString &nLang, const OString &rTEXT, const OString &rQHTEXT, const OString &rTITLE, const OString &sFilename, bool bFirstLang, bool bCaseSensitive); @@ -143,8 +144,8 @@ class MergeDataFile MergeEntrys *GetMergeEntrys( ResData *pResData ); MergeEntrys *GetMergeEntrysCaseSensitive( ResData *pResData ); - static OString CreateKey(const OString& rTYP, const OString& rGID, - const OString& rLID, const OString& rFilename, bool bCaseSensitive); + static OString CreateKey(std::string_view rTYP, std::string_view rGID, + std::string_view rLID, const OString& rFilename, bool bCaseSensitive); }; diff --git a/l10ntools/inc/helper.hxx b/l10ntools/inc/helper.hxx index 621218a0c1b7..c63f781a5d91 100644 --- a/l10ntools/inc/helper.hxx +++ b/l10ntools/inc/helper.hxx @@ -13,6 +13,9 @@ #define INCLUDED_L10NTOOLS_INC_HELPER_HXX #include <sal/config.h> + +#include <string_view> + #include <sal/types.h> #include <libxml/parser.h> @@ -36,7 +39,7 @@ OString QuotHTML( const OString &rString ); OString UnQuotHTML( const OString& rString ); /// Check whether text is a valid XML expression -bool isWellFormedXML( OString const & text ); +bool isWellFormedXML( std::string_view text ); /// Convert xmlChar* to OString OString xmlStrToOString( const xmlChar* pString ); diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx index 99c9270df9fe..3f9426b6b4de 100644 --- a/l10ntools/inc/helpmerge.hxx +++ b/l10ntools/inc/helpmerge.hxx @@ -20,6 +20,10 @@ #ifndef INCLUDED_L10NTOOLS_INC_HELPMERGE_HXX #define INCLUDED_L10NTOOLS_INC_HELPMERGE_HXX +#include <sal/config.h> + +#include <string_view> + #include "xmlparse.hxx" #include <rtl/ustring.hxx> #include <rtl/ustrbuf.hxx> @@ -45,7 +49,7 @@ public: /// Method append a PO file with the content of a parsed XML file /// @PRECOND rHelpFile is valid static bool CreatePO( const OString &rPOFile_in, const OString &sHelpFile, - XMLFile *pXmlFile, const OString &rGsi1 ); + XMLFile *pXmlFile, std::string_view rGsi1 ); /// Method merges the String into XMLfile, which must point to an existing file. bool Merge( const OString &rDestinationFile_in , diff --git a/l10ntools/inc/po.hxx b/l10ntools/inc/po.hxx index 778d70fe6cc9..db513cab1f8e 100644 --- a/l10ntools/inc/po.hxx +++ b/l10ntools/inc/po.hxx @@ -12,6 +12,8 @@ #include <fstream> #include <memory> +#include <string_view> + #include <rtl/string.hxx> class PoOfstream; @@ -44,8 +46,8 @@ public: enum Exception { NOSOURCFILE, NORESTYPE, NOGROUPID, NOSTRING, WRONGHELPTEXT }; PoEntry(); - PoEntry( const OString& rSourceFile, const OString& rResType, const OString& rGroupId, - const OString& rLocalId, const OString& rHelpText, const OString& rText, + PoEntry( const OString& rSourceFile, std::string_view rResType, std::string_view rGroupId, + std::string_view rLocalId, const OString& rHelpText, const OString& rText, const TYPE eType ); ~PoEntry(); @@ -87,8 +89,8 @@ public: friend class PoOfstream; friend class PoIfstream; - PoHeader( const OString& rExtSrc ); ///< Template Constructor - PoHeader( const OString& rExtSrc, const OString& rPoHeaderMsgStr ); + PoHeader( std::string_view rExtSrc ); ///< Template Constructor + PoHeader( std::string_view rExtSrc, const OString& rPoHeaderMsgStr ); ~PoHeader(); PoHeader(const PoHeader&) = delete; PoHeader& operator=(const PoHeader&) = delete; diff --git a/l10ntools/inc/xrmmerge.hxx b/l10ntools/inc/xrmmerge.hxx index fd54f113b68b..7468f43f6122 100644 --- a/l10ntools/inc/xrmmerge.hxx +++ b/l10ntools/inc/xrmmerge.hxx @@ -24,7 +24,7 @@ #include <sal/config.h> #include <fstream> - +#include <string_view> /// Parser for *.xrm and description.xml files class XRMResParser @@ -39,7 +39,7 @@ private: OString sCurrentCloseTag; OString sCurrentText; protected: - static OString GetAttribute( const OString &rToken, const OString &rAttribute ); + static OString GetAttribute( const OString &rToken, std::string_view rAttribute ); static void Error( const OString &rError ); virtual void Output( const OString& rOutput )=0; |