diff options
| author | наб <nabijaczleweli@nabijaczleweli.xyz> | 2025-01-23 20:52:23 +0100 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2025-02-14 19:45:12 +0100 |
| commit | b1e826ae216eb473469ba7e4f43b0e4a7f7d6388 (patch) | |
| tree | d64f54dab5b42e60cff6523447cb99593d22dc51 /apt-pkg | |
| parent | 729a5c8f4fb8c841497d26170e1a47c41617ecd9 (diff) | |
Take const& in {,Real}FileExists()
Diffstat (limited to 'apt-pkg')
| -rw-r--r-- | apt-pkg/contrib/fileutl.cc | 4 | ||||
| -rw-r--r-- | apt-pkg/contrib/fileutl.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index ee0b7a04a..31f351b08 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -330,7 +330,7 @@ int GetLock(string File,bool Errors) // FileExists - Check if a file exists /*{{{*/ // --------------------------------------------------------------------- /* Beware: Directories are also files! */ -bool FileExists(string File) +bool FileExists(string const &File) { struct stat Buf; if (stat(File.c_str(),&Buf) != 0) @@ -341,7 +341,7 @@ bool FileExists(string File) // RealFileExists - Check if a file exists and if it is really a file /*{{{*/ // --------------------------------------------------------------------- /* */ -bool RealFileExists(string File) +bool RealFileExists(string const &File) { struct stat Buf; if (stat(File.c_str(),&Buf) != 0) diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 5d1e4ab69..503135731 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -182,8 +182,8 @@ APT_PUBLIC bool CopyFile(FileFd &From,FileFd &To); APT_PUBLIC bool RemoveFile(char const * const Function, std::string const &FileName); APT_PUBLIC bool RemoveFileAt(char const * const Function, int const dirfd, std::string const &FileName); APT_PUBLIC int GetLock(std::string File,bool Errors = true); -APT_PUBLIC bool FileExists(std::string File); -APT_PUBLIC bool RealFileExists(std::string File); +APT_PUBLIC bool FileExists(std::string const &File); +APT_PUBLIC bool RealFileExists(std::string const &File); APT_PUBLIC bool DirectoryExists(std::string const &Path); APT_PUBLIC bool CreateDirectory(std::string const &Parent, std::string const &Path); APT_PUBLIC time_t GetModificationTime(std::string const &Path); |
