UDirectory.h
Go to the documentation of this file.
00001 /*
00002 *  utilite is a cross-platform library with
00003 *  useful utilities for fast and small developing.
00004 *  Copyright (C) 2010  Mathieu Labbe
00005 *
00006 *  utilite is free library: you can redistribute it and/or modify
00007 *  it under the terms of the GNU Lesser General Public License as published by
00008 *  the Free Software Foundation, either version 3 of the License, or
00009 *  (at your option) any later version.
00010 *
00011 *  utilite is distributed in the hope that it will be useful,
00012 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 *  GNU Lesser General Public License for more details.
00015 *
00016 *  You should have received a copy of the GNU Lesser General Public License
00017 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018 */
00019 
00020 #ifndef UDIRECTORY_H
00021 #define UDIRECTORY_H
00022 
00023 #include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
00024 
00025 #include <string>
00026 #include <vector>
00027 #include <list>
00028 
00034 class UTILITE_EXP UDirectory
00035 {
00036 public:
00042         static bool exists(const std::string & dirPath);
00043 
00049         static std::string getDir(const std::string & filePath);
00050 
00056         static std::string currentDir(bool trailingSeparator = false);
00057 
00063         static bool makeDir(const std::string & dirPath);
00064 
00070         static bool removeDir(const std::string & dirPath);
00071 
00076         static std::string homeDir();
00077 
00081         static std::string separator();
00082 
00083 public:
00090         UDirectory(const std::string & path = "", const std::string & extensions = "");
00091         UDirectory(const UDirectory & dir);
00092         UDirectory & operator=(const UDirectory & dir);
00093         ~UDirectory();
00094 
00099         void setPath(const std::string & path, const std::string & extensions = "");
00100 
00104         void update();
00105 
00110         bool isValid();
00111 
00116         std::string getNextFileName();
00117 
00122         std::string getNextFilePath();
00123 
00129         const std::list<std::string> & getFileNames() const {return fileNames_;}
00130 
00134         void rewind();
00135 
00136 private:
00137         std::string path_;
00138         std::vector<std::string> extensions_;
00139         std::list<std::string> fileNames_;
00140         std::list<std::string>::iterator iFileName_;
00141 };
00142 
00143 #endif /* UDIRECTORY_H */


rtabmap
Author(s): Mathieu Labbe
autogenerated on Sat Jul 23 2016 11:44:28