Changeset 13041 for OpenSceneGraph/trunk/src/osgDB/FileNameUtils.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/src/osgDB/FileNameUtils.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgDB/FileNameUtils.cpp
r12401 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 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 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 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 72 72 { 73 73 std::string new_fileName(fileName); 74 74 75 75 std::string::size_type slash = 0; 76 76 while( (slash=new_fileName.find_first_of(UNIX_PATH_SEPARATOR,slash)) != std::string::npos) … … 84 84 { 85 85 std::string new_fileName(fileName); 86 86 87 87 std::string::size_type slash = 0; 88 88 while( (slash=new_fileName.find_first_of(WINDOWS_PATH_SEPARATOR,slash)) != std::string::npos) … … 202 202 // need to check for :// 203 203 std::string::size_type pos(filename.find("://")); 204 if (pos == std::string::npos) 204 if (pos == std::string::npos) 205 205 return false; 206 206 std::string proto(filename.substr(0, pos)); 207 207 208 208 return Registry::instance()->isProtocolRegistered(proto); 209 209 } … … 221 221 { 222 222 std::string::size_type pos(filename.find("://")); 223 223 224 224 if (pos != std::string::npos) 225 225 { … … 252 252 return ""; 253 253 } 254 254 255 255 } 256 256 return filename; … … 360 360 char resolved_path[PATH_MAX]; 361 361 char* result = realpath(path.c_str(), resolved_path); 362 362 363 363 if (result) return std::string(resolved_path); 364 364 else return path; 365 #endif 365 #endif 366 366 } 367 367
