Doxygen
Loading...
Searching...
No Matches
fileinfo.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2021 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16#ifndef FILEINFO_H
17#define FILEINFO_H
18
19#include <string>
20
21/** @brief Minimal replacement for QFileInfo. */
23{
24 public:
25 explicit FileInfo(const std::string &name) : m_name(name) {}
26 bool exists() const;
27 size_t size() const;
28 bool isWritable() const;
29 bool isReadable() const;
30 bool isExecutable() const;
31 bool isRelative() const;
32 bool isFile() const;
33 bool isDir() const;
34 bool isSymLink() const;
35 std::string readLink() const;
36 std::string filePath() const;
37 std::string absFilePath() const;
38 std::string fileName() const;
39 std::string baseName() const;
40 std::string extension(bool complete) const;
41 std::string dirPath(bool absPath = true) const;
42 private:
43 static void correctPath(std::string &s);
44 std::string m_name;
45};
46
47#endif
std::string m_name
Definition fileinfo.h:44
std::string readLink() const
Definition fileinfo.cpp:84
bool isRelative() const
Definition fileinfo.cpp:58
bool isSymLink() const
Definition fileinfo.cpp:77
bool isExecutable() const
Definition fileinfo.cpp:51
FileInfo(const std::string &name)
Definition fileinfo.h:25
bool exists() const
Definition fileinfo.cpp:30
bool isWritable() const
Definition fileinfo.cpp:37
size_t size() const
Definition fileinfo.cpp:23
std::string extension(bool complete) const
Definition fileinfo.cpp:130
std::string fileName() const
Definition fileinfo.cpp:118
bool isReadable() const
Definition fileinfo.cpp:44
bool isDir() const
Definition fileinfo.cpp:70
static void correctPath(std::string &s)
Definition fileinfo.cpp:96
bool isFile() const
Definition fileinfo.cpp:63
std::string dirPath(bool absPath=true) const
Definition fileinfo.cpp:137
std::string filePath() const
Definition fileinfo.cpp:91
std::string baseName() const
Definition fileinfo.cpp:123
std::string absFilePath() const
Definition fileinfo.cpp:101