RTAB-Map 0.23.10
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
81 static std::string separator();
82
83public:
90 UDirectory(const std::string & path = "", const std::string & extensions = "");
91 UDirectory(const UDirectory & dir);
92 UDirectory & operator=(const UDirectory & dir);
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
136private:
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 */
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:129
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)