source: trunk/lib/utility/FileIO.h @ 303

Last change on this file since 303 was 303, checked in by Peter, 17 years ago

docs

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 988 bytes
Line 
1// $Id: FileIO.h 303 2005-04-30 16:17:35Z peter $
2
3#ifndef _theplu_utility_fileio_
4#define _theplu_utility_fileio_
5
6#include <string>
7
8namespace theplu {
9namespace utility {
10
11  ///
12  /// FileIO is useful for many common task on files.
13  ///
14  class FileIO {
15  public:
16
17    ///
18    /// Check if access permissions match \a mode. \a mode must be
19    /// given as r, w, x, or combinations of these letters.
20    ///
21    /// @return On success (all requested permissions granted), zero
22    /// is returned. On error (at least one bit in mode asked for a
23    /// permission that is denied, or some other error occurred), -1
24    /// is returned, and errno is set appropriately.
25    ///
26    /// @see access(2)
27    ///
28    /// @note Checking for write permissions will fail if the file
29    /// does not exists. This should be fixed so that when a file does
30    /// not exist, permissions to create the file should be returned.
31    ///
32    int access_rights(const std::string& path,const std::string& bits) const;
33
34  };
35
36}} // of namespace utility and namespace theplu
37
38#endif
Note: See TracBrowser for help on using the repository browser.