UDirectory.h
Go to the documentation of this file.
00001 // Taken from UtiLite library r185 [www.utilite.googlecode.com]
00002 
00003 /*
00004 *  utilite is a cross-platform library with
00005 *  useful utilities for fast and small developing.
00006 *  Copyright (C) 2010  Mathieu Labbe
00007 *
00008 *  utilite is free library: you can redistribute it and/or modify
00009 *  it under the terms of the GNU Lesser General Public License as published by
00010 *  the Free Software Foundation, either version 3 of the License, or
00011 *  (at your option) any later version.
00012 *
00013 *  utilite is distributed in the hope that it will be useful,
00014 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 *  GNU Lesser General Public License for more details.
00017 *
00018 *  You should have received a copy of the GNU Lesser General Public License
00019 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00020 */
00021 
00022 #ifndef UDIRECTORY_H
00023 #define UDIRECTORY_H
00024 
00025 //#include "utilite/UtiLiteExp.h" // DLL export/import defines
00026 
00027 #include <string>
00028 #include <vector>
00029 #include <list>
00030 
00036 class UDirectory
00037 {
00038 public:
00044         static bool exists(const std::string & dirPath);
00045 
00051         static std::string getDir(const std::string & filePath);
00052 
00058         static std::string currentDir(bool trailingSeparator = false);
00059 
00065         static bool makeDir(const std::string & dirPath);
00066 
00072         static bool removeDir(const std::string & dirPath);
00073 
00078         static std::string homeDir();
00079 
00083         static std::string separator();
00084 
00085 public:
00092         UDirectory(const std::string & path = "", const std::string & extensions = "");
00093         UDirectory(const UDirectory & dir);
00094         UDirectory & operator=(const UDirectory & dir);
00095         ~UDirectory();
00096 
00101         void setPath(const std::string & path, const std::string & extensions = "");
00102 
00106         void update();
00107 
00112         bool isValid();
00113 
00118         std::string getNextFileName();
00119 
00125         const std::list<std::string> & getFileNames() const {return fileNames_;}
00126 
00130         void rewind();
00131 
00132 private:
00133         std::string path_;
00134         std::vector<std::string> extensions_;
00135         std::list<std::string> fileNames_;
00136         std::list<std::string>::iterator iFileName_;
00137 };
00138 
00139 #endif /* UDIRECTORY_H */


find_object_2d
Author(s): Mathieu Labbe
autogenerated on Thu Feb 11 2016 22:57:56