yat  0.14.5pre
FileUtil.h
1 #ifndef _theplu_yat_utility_fileutil_
2 #define _theplu_yat_utility_fileutil_
3 
4 // $Id: FileUtil.h 2125 2009-12-22 20:19:41Z peter $
5 
6 /*
7  Copyright (C) 2004 Jari Häkkinen
8  Copyright (C) 2005 Jari Häkkinen, Peter Johansson
9  Copyright (C) 2006 Jari Häkkinen
10  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
11  Copyright (C) 2009 Peter Johansson
12 
13  This file is part of the yat library, http://dev.thep.lu.se/yat
14 
15  The yat library is free software; you can redistribute it and/or
16  modify it under the terms of the GNU General Public License as
17  published by the Free Software Foundation; either version 3 of the
18  License, or (at your option) any later version.
19 
20  The yat library is distributed in the hope that it will be useful,
21  but WITHOUT ANY WARRANTY; without even the implied warranty of
22  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23  General Public License for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with yat. If not, see <http://www.gnu.org/licenses/>.
27 */
28 
29 #include <string>
30 #include <sys/stat.h>
31 #include <unistd.h>
32 
33 namespace theplu {
34 namespace yat {
35 namespace utility {
36 
43  class FileUtil {
44  public:
45 
49  explicit FileUtil(const std::string& path);
50 
56  FileUtil(const FileUtil&);
57 
79  int permissions(const std::string& bits) const;
80 
93  bool exists(void) const;
94 
106  bool lexists(void) const;
107 
111  const std::string& path(void) const;
112 
118  FileUtil& operator=(const FileUtil&);
119 
120  private:
121  bool exists_common(bool) const;
122 
123  std::string path_;
124  };
125 
126 }}} // of namespace utility, yat, and theplu
127 
128 #endif
bool exists(void) const
Check whether file exists.
FileUtil & operator=(const FileUtil &)
assignment operator
const std::string & path(void) const
Get path associated with the object.
Checking file/directory existence and access permissions.
Definition: FileUtil.h:43
int permissions(const std::string &bits) const
Check file/directory permissions.
FileUtil(const std::string &path)
Constructor, copies path only.

Generated on Tue Sep 26 2017 02:33:29 for yat by  doxygen 1.8.5