root/OpenSceneGraph/trunk/include/osgDB/FileNameUtils @ 8912

Revision 8912, 2.4 kB (checked in by robert, 6 years ago)

Added getExtensionIncludingDot to provide more efficient handling of extensions

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
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
21namespace osgDB {
22
23extern OSGDB_EXPORT std::string getFilePath(const std::string& filename);
24extern OSGDB_EXPORT std::string getFileExtension(const std::string& filename);
25extern OSGDB_EXPORT std::string getFileExtensionIncludingDot(const std::string& filename);
26extern OSGDB_EXPORT std::string getLowerCaseFileExtension(const std::string& filename);
27extern OSGDB_EXPORT std::string getSimpleFileName(const std::string& fileName);
28extern OSGDB_EXPORT std::string getNameLessExtension(const std::string& fileName);
29extern OSGDB_EXPORT std::string getStrippedName(const std::string& fileName);
30
31
32extern OSGDB_EXPORT std::string convertFileNameToWindowsStyle(const std::string& fileName);
33extern OSGDB_EXPORT std::string convertFileNameToUnixStyle(const std::string& fileName);
34extern OSGDB_EXPORT std::string convertToLowerCase(const std::string& fileName);
35
36extern OSGDB_EXPORT bool isFileNameNativeStyle(const std::string& fileName);
37extern OSGDB_EXPORT std::string convertFileNameToNativeStyle(const std::string& fileName);
38
39extern OSGDB_EXPORT bool equalCaseInsensitive(const std::string& lhs,const std::string& rhs);
40extern OSGDB_EXPORT bool equalCaseInsensitive(const std::string& lhs,const char* rhs);
41
42extern OSGDB_EXPORT bool containsServerAddress(const std::string& filename);
43extern OSGDB_EXPORT std::string getServerAddress(const std::string& filename);
44extern OSGDB_EXPORT std::string getServerFileName(const std::string& filename);
45
46/** Concatenates two paths */
47extern OSGDB_EXPORT std::string concatPaths(const std::string& left, const std::string& right);
48
49/** Removes .. and . dirs in a path */
50extern OSGDB_EXPORT std::string getRealPath(const std::string& path);
51
52
53}
54
55#endif
Note: See TracBrowser for help on using the browser.