| 1 | /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield |
|---|
| 2 | * |
|---|
| 3 | * This library is open source and may be redistributed and/or modified under |
|---|
| 4 | * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or |
|---|
| 5 | * (at your option) any later version. The full license is in LICENSE file |
|---|
| 6 | * included with this distribution, and on the openscenegraph.org website. |
|---|
| 7 | * |
|---|
| 8 | * This library is distributed in the hope that it will be useful, |
|---|
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 11 | * OpenSceneGraph Public License for more details. |
|---|
| 12 | */ |
|---|
| 13 | |
|---|
| 14 | #ifndef OSGDB_FILENAMEUTILS |
|---|
| 15 | #define OSGDB_FILENAMEUTILS 1 |
|---|
| 16 | |
|---|
| 17 | #include <osgDB/Export> |
|---|
| 18 | |
|---|
| 19 | #include <string> |
|---|
| 20 | |
|---|
| 21 | namespace osgDB { |
|---|
| 22 | |
|---|
| 23 | extern OSGDB_EXPORT std::string getFilePath(const std::string& filename); |
|---|
| 24 | extern OSGDB_EXPORT std::string getFileExtension(const std::string& filename); |
|---|
| 25 | extern OSGDB_EXPORT std::string getFileExtensionIncludingDot(const std::string& filename); |
|---|
| 26 | extern OSGDB_EXPORT std::string getLowerCaseFileExtension(const std::string& filename); |
|---|
| 27 | extern OSGDB_EXPORT std::string getSimpleFileName(const std::string& fileName); |
|---|
| 28 | extern OSGDB_EXPORT std::string getNameLessExtension(const std::string& fileName); |
|---|
| 29 | extern OSGDB_EXPORT std::string getStrippedName(const std::string& fileName); |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | extern OSGDB_EXPORT std::string convertFileNameToWindowsStyle(const std::string& fileName); |
|---|
| 33 | extern OSGDB_EXPORT std::string convertFileNameToUnixStyle(const std::string& fileName); |
|---|
| 34 | extern OSGDB_EXPORT std::string convertToLowerCase(const std::string& fileName); |
|---|
| 35 | |
|---|
| 36 | extern OSGDB_EXPORT bool isFileNameNativeStyle(const std::string& fileName); |
|---|
| 37 | extern OSGDB_EXPORT std::string convertFileNameToNativeStyle(const std::string& fileName); |
|---|
| 38 | |
|---|
| 39 | extern OSGDB_EXPORT bool equalCaseInsensitive(const std::string& lhs,const std::string& rhs); |
|---|
| 40 | extern OSGDB_EXPORT bool equalCaseInsensitive(const std::string& lhs,const char* rhs); |
|---|
| 41 | |
|---|
| 42 | extern OSGDB_EXPORT bool containsServerAddress(const std::string& filename); |
|---|
| 43 | extern OSGDB_EXPORT std::string getServerProtocol(const std::string& filename); |
|---|
| 44 | extern OSGDB_EXPORT std::string getServerAddress(const std::string& filename); |
|---|
| 45 | extern OSGDB_EXPORT std::string getServerFileName(const std::string& filename); |
|---|
| 46 | |
|---|
| 47 | /** Concatenates two paths */ |
|---|
| 48 | extern OSGDB_EXPORT std::string concatPaths(const std::string& left, const std::string& right); |
|---|
| 49 | |
|---|
| 50 | /** Removes .. and . dirs in a path */ |
|---|
| 51 | extern OSGDB_EXPORT std::string getRealPath(const std::string& path); |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | } |
|---|
| 55 | |
|---|
| 56 | #endif |
|---|