From d52b5f1e6afabce99860d6dcdbc39db8204f58da Mon Sep 17 00:00:00 2001 From: badaix Date: Wed, 25 Mar 2020 08:37:18 +0100 Subject: [PATCH] Make some functions const --- server/streamreader/process_stream.cpp | 4 ++-- server/streamreader/process_stream.hpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server/streamreader/process_stream.cpp b/server/streamreader/process_stream.cpp index a7bc566d..3976f3b2 100644 --- a/server/streamreader/process_stream.cpp +++ b/server/streamreader/process_stream.cpp @@ -44,14 +44,14 @@ ProcessStream::ProcessStream(PcmListener* pcmListener, boost::asio::io_context& } -bool ProcessStream::fileExists(const std::string& filename) +bool ProcessStream::fileExists(const std::string& filename) const { struct stat buffer; return (stat(filename.c_str(), &buffer) == 0); } -std::string ProcessStream::findExe(const std::string& filename) +std::string ProcessStream::findExe(const std::string& filename) const { /// check if filename exists if (fileExists(filename)) diff --git a/server/streamreader/process_stream.hpp b/server/streamreader/process_stream.hpp index d81eab16..4e726701 100644 --- a/server/streamreader/process_stream.hpp +++ b/server/streamreader/process_stream.hpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "posix_stream.hpp" #include "watchdog.hpp" @@ -66,8 +67,8 @@ protected: virtual void onStderrMsg(const std::string& line); virtual void initExeAndPath(const std::string& filename); - bool fileExists(const std::string& filename); - std::string findExe(const std::string& filename); + bool fileExists(const std::string& filename) const; + std::string findExe(const std::string& filename) const; size_t wd_timeout_sec_; std::unique_ptr watchdog_;