RTAB-Map 0.24.5
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
UDirectory.h
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/utilite_export.h" // DLL export/import defines
24
25#include <string>
26#include <vector>
27#include <list>
28
34class UTILITE_EXPORT UDirectory
35{
36public:
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
85 static std::string expandHomeDir(const std::string & path);
86
90 static std::string separator();
91
92public:
99 UDirectory(const std::string & path = "", const std::string & extensions = "");
100 UDirectory(const UDirectory & dir);
101 UDirectory & operator=(const UDirectory & dir);
102 ~UDirectory();
103
108 void setPath(const std::string & path, const std::string & extensions = "");
109
113 void update();
114
119 bool isValid();
120
125 std::string getNextFileName();
126
131 std::string getNextFilePath();
132
138 const std::list<std::string> & getFileNames() const {return fileNames_;}
139
143 void rewind();
144
145private:
146 std::string path_;
147 std::vector<std::string> extensions_;
148 std::list<std::string> fileNames_;
149 std::list<std::string>::iterator iFileName_;
150};
151
152#endif /* UDIRECTORY_H */
static std::string getDir(const std::string &filePath)
std::string getNextFilePath()
static std::string currentDir(bool trailingSeparator=false)
static std::string homeDir()
static std::string separator()
static bool removeDir(const std::string &dirPath)
std::string getNextFileName()
bool isValid()
static bool makeDir(const std::string &dirPath)
const std::list< std::string > & getFileNames() const
Definition UDirectory.h:138
void setPath(const std::string &path, const std::string &extensions="")
void update()
void rewind()
UDirectory(const std::string &path="", const std::string &extensions="")
static bool exists(const std::string &dirPath)
static std::string expandHomeDir(const std::string &path)