]> granicus.if.org Git - icinga2/commitdiff
Added missing const qualifiers.
authorGunnar Beutner <gunnar.beutner@netways.de>
Sat, 2 Feb 2013 08:19:49 +0000 (09:19 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Sat, 2 Feb 2013 08:19:49 +0000 (09:19 +0100)
lib/base/utility.cpp
lib/base/utility.h

index 2595a1d94ab42b0ba243260e7b160f9c1c123919..195ac9ee9f72ca94d5f54395ac93543f1ff8b558 100644 (file)
@@ -170,7 +170,7 @@ void Utility::InitializeOpenSSL(void)
  * @param cakey CA certificate chain file.
  * @returns An SSL context.
  */
-shared_ptr<SSL_CTX> Utility::MakeSSLContext(String pubkey, String privkey, String cakey)
+shared_ptr<SSL_CTX> Utility::MakeSSLContext(const String& pubkey, const String& privkey, const String& cakey)
 {
        InitializeOpenSSL();
 
@@ -224,7 +224,7 @@ String Utility::GetCertificateCN(const shared_ptr<X509>& certificate)
  * @param pemfile The filename.
  * @returns An X509 certificate.
  */
-shared_ptr<X509> Utility::GetX509Certificate(String pemfile)
+shared_ptr<X509> Utility::GetX509Certificate(const String& pemfile)
 {
        X509 *cert;
        BIO *fpcert = BIO_new(BIO_s_file());
@@ -254,7 +254,7 @@ shared_ptr<X509> 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);
 }
index 347fd18ae80f0b8a494fb925fc9a1f1fed06d350..bbccaa49e2634c1f7b3926777ececc5655c7e548 100644 (file)
@@ -37,11 +37,11 @@ public:
 
        static void Daemonize(void);
 
-       static shared_ptr<SSL_CTX> MakeSSLContext(String pubkey, String privkey, String cakey);
+       static shared_ptr<SSL_CTX> MakeSSLContext(const String& pubkey, const String& privkey, const String& cakey);
        static String GetCertificateCN(const shared_ptr<X509>& certificate);
-       static shared_ptr<X509> GetX509Certificate(String pemfile);
+       static shared_ptr<X509> 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);