UDirectory.h
Go to the documentation of this file.
1 /*
2 * utilite is a cross-platform library with
3 * useful utilities for fast and small developing.
4 * Copyright (C) 2010 Mathieu Labbe
5 *
6 * utilite is free library: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * utilite is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef UDIRECTORY_H
21 #define UDIRECTORY_H
22 
23 #include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
24 
25 #include <string>
26 #include <vector>
27 #include <list>
28 
35 {
36 public:
42  static bool exists(const std::string & dirPath);
43 
49  static std::string getDir(const std::string & filePath);
50 
56  static std::string currentDir(bool trailingSeparator = false);
57 
63  static bool makeDir(const std::string & dirPath);
64 
70  static bool removeDir(const std::string & dirPath);
71 
76  static std::string homeDir();
77 
81  static std::string separator();
82 
83 public:
90  UDirectory(const std::string & path = "", const std::string & extensions = "");
91  UDirectory(const UDirectory & dir);
92  UDirectory & operator=(const UDirectory & dir);
93  ~UDirectory();
94 
99  void setPath(const std::string & path, const std::string & extensions = "");
100 
104  void update();
105 
110  bool isValid();
111 
116  std::string getNextFileName();
117 
122  std::string getNextFilePath();
123 
129  const std::list<std::string> & getFileNames() const {return fileNames_;}
130 
134  void rewind();
135 
136 private:
137  std::string path_;
138  std::vector<std::string> extensions_;
139  std::list<std::string> fileNames_;
140  std::list<std::string>::iterator iFileName_;
141 };
142 
143 #endif /* UDIRECTORY_H */
const std::list< std::string > & getFileNames() const
Definition: UDirectory.h:129
std::list< std::string > fileNames_
Definition: UDirectory.h:139
#define UTILITE_EXP
Definition: UtiLiteExp.h:33
std::vector< std::string > extensions_
Definition: UDirectory.h:138
std::list< std::string >::iterator iFileName_
Definition: UDirectory.h:140
std::string path_
Definition: UDirectory.h:137


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Dec 14 2020 03:37:06