UDirectory.h
Go to the documentation of this file.
1 // Taken from UtiLite library r185 [www.utilite.googlecode.com]
2 
3 /*
4 * utilite is a cross-platform library with
5 * useful utilities for fast and small developing.
6 * Copyright (C) 2010 Mathieu Labbe
7 *
8 * utilite is free library: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * utilite is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 #ifndef UDIRECTORY_H
23 #define UDIRECTORY_H
24 
25 //#include "utilite/UtiLiteExp.h" // DLL export/import defines
26 
27 #include <string>
28 #include <vector>
29 #include <list>
30 
37 {
38 public:
44  static bool exists(const std::string & dirPath);
45 
51  static std::string getDir(const std::string & filePath);
52 
58  static std::string currentDir(bool trailingSeparator = false);
59 
65  static bool makeDir(const std::string & dirPath);
66 
72  static bool removeDir(const std::string & dirPath);
73 
78  static std::string homeDir();
79 
83  static std::string separator();
84 
85 public:
92  UDirectory(const std::string & path = "", const std::string & extensions = "");
93  UDirectory(const UDirectory & dir);
94  UDirectory & operator=(const UDirectory & dir);
95  ~UDirectory();
96 
101  void setPath(const std::string & path, const std::string & extensions = "");
102 
106  void update();
107 
112  bool isValid();
113 
118  std::string getNextFileName();
119 
125  const std::list<std::string> & getFileNames() const {return fileNames_;}
126 
130  void rewind();
131 
132 private:
133  std::string path_;
134  std::vector<std::string> extensions_;
135  std::list<std::string> fileNames_;
136  std::list<std::string>::iterator iFileName_;
137 };
138 
139 #endif /* UDIRECTORY_H */
static std::string homeDir()
Definition: UDirectory.cpp:344
void rewind()
Definition: UDirectory.cpp:232
static bool makeDir(const std::string &dirPath)
Definition: UDirectory.cpp:322
bool isValid()
Definition: UDirectory.cpp:216
const std::list< std::string > & getFileNames() const
Definition: UDirectory.h:125
std::list< std::string > fileNames_
Definition: UDirectory.h:135
static std::string getDir(const std::string &filePath)
Definition: UDirectory.cpp:262
UDirectory(const std::string &path="", const std::string &extensions="")
Definition: UDirectory.cpp:63
static std::string separator()
Definition: UDirectory.cpp:365
UDirectory & operator=(const UDirectory &dir)
Definition: UDirectory.cpp:76
std::vector< std::string > extensions_
Definition: UDirectory.h:134
static std::string currentDir(bool trailingSeparator=false)
Definition: UDirectory.cpp:298
void setPath(const std::string &path, const std::string &extensions="")
Definition: UDirectory.cpp:95
std::list< std::string >::iterator iFileName_
Definition: UDirectory.h:136
void update()
Definition: UDirectory.cpp:104
std::string path_
Definition: UDirectory.h:133
std::string getNextFileName()
Definition: UDirectory.cpp:221
static bool removeDir(const std::string &dirPath)
Definition: UDirectory.cpp:333
static bool exists(const std::string &dirPath)
Definition: UDirectory.cpp:238


find_object_2d
Author(s): Mathieu Labbe
autogenerated on Mon Jun 10 2019 13:21:31