From: Gunnar Beutner Date: Sat, 2 Feb 2013 08:19:49 +0000 (+0100) Subject: Added missing const qualifiers. X-Git-Tag: v0.0.2~582 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=18f935cfa274d67a3f7054f3a93d60d2b71da1ab;p=icinga2 Added missing const qualifiers. --- diff --git a/lib/base/utility.cpp b/lib/base/utility.cpp index 2595a1d94..195ac9ee9 100644 --- a/lib/base/utility.cpp +++ b/lib/base/utility.cpp @@ -170,7 +170,7 @@ void Utility::InitializeOpenSSL(void) * @param cakey CA certificate chain file. * @returns An SSL context. */ -shared_ptr Utility::MakeSSLContext(String pubkey, String privkey, String cakey) +shared_ptr Utility::MakeSSLContext(const String& pubkey, const String& privkey, const String& cakey) { InitializeOpenSSL(); @@ -224,7 +224,7 @@ String Utility::GetCertificateCN(const shared_ptr& certificate) * @param pemfile The filename. * @returns An X509 certificate. */ -shared_ptr Utility::GetX509Certificate(String pemfile) +shared_ptr Utility::GetX509Certificate(const String& pemfile) { X509 *cert; BIO *fpcert = BIO_new(BIO_s_file()); @@ -254,7 +254,7 @@ shared_ptr Utility::GetX509Certificate(String pemfile) * @param text The String that should be checked. * @returns true if the wildcard pattern matches, false otherwise. */ -bool Utility::Match(String pattern, String text) +bool Utility::Match(const String& pattern, const String& text) { return (match(pattern.CStr(), text.CStr()) == 0); } diff --git a/lib/base/utility.h b/lib/base/utility.h index 347fd18ae..bbccaa49e 100644 --- a/lib/base/utility.h +++ b/lib/base/utility.h @@ -37,11 +37,11 @@ public: static void Daemonize(void); - static shared_ptr MakeSSLContext(String pubkey, String privkey, String cakey); + static shared_ptr MakeSSLContext(const String& pubkey, const String& privkey, const String& cakey); static String GetCertificateCN(const shared_ptr& certificate); - static shared_ptr GetX509Certificate(String pemfile); + static shared_ptr GetX509Certificate(const String& pemfile); - static bool Match(String pattern, String text); + static bool Match(const String& pattern, const String& text); static String DirName(const String& path); static String BaseName(const String& path);