00001 /* 00002 Copyright 2008 Larry Gritz and the other authors and contributors. 00003 All Rights Reserved. 00004 00005 Redistribution and use in source and binary forms, with or without 00006 modification, are permitted provided that the following conditions are 00007 met: 00008 * Redistributions of source code must retain the above copyright 00009 notice, this list of conditions and the following disclaimer. 00010 * Redistributions in binary form must reproduce the above copyright 00011 notice, this list of conditions and the following disclaimer in the 00012 documentation and/or other materials provided with the distribution. 00013 * Neither the name of the software's owners nor the names of its 00014 contributors may be used to endorse or promote products derived from 00015 this software without specific prior written permission. 00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00017 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00018 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00019 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00020 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00021 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00022 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00023 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00024 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00025 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00026 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00027 00028 (This is the Modified BSD License) 00029 */ 00030 00031 00042 00043 00044 #ifndef OPENIMAGEIO_FILESYSTEM_H 00045 #define OPENIMAGEIO_FILESYSTEM_H 00046 00047 #include <string> 00048 #include "export.h" 00049 00050 00051 #ifdef OPENIMAGEIO_NAMESPACE 00052 namespace OPENIMAGEIO_NAMESPACE { 00053 #endif 00054 00059 00060 namespace Filesystem { 00061 00064 DLLPUBLIC std::string file_extension (const std::string &filepath); 00065 00071 DLLPUBLIC void searchpath_split (const std::string &searchpath, 00072 std::vector<std::string> &dirs, 00073 bool validonly = false); 00074 00082 DLLPUBLIC std::string searchpath_find (const std::string &filename, 00083 const std::vector<std::string> &dirs, 00084 bool testcwd = true); 00085 00088 DLLPUBLIC bool path_is_absolute (const std::string &path, 00089 bool dot_is_absolute=false); 00090 00091 00092 }; // namespace Filesystem 00093 00094 #ifdef OPENIMAGEIO_NAMESPACE 00095 }; // end namespace OPENIMAGEIO_NAMESPACE 00096 using namespace OPENIMAGEIO_NAMESPACE; 00097 #endif 00098 00099 #endif // OPENIMAGEIO_FILESYSTEM_H