|
Revision 13041, 1.5 kB
(checked in by robert, 14 months ago)
|
|
Ran script to remove trailing spaces and tabs
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | #include <osgDB/AuthenticationMap> |
|---|
| 15 | #include <osgDB/FileNameUtils> |
|---|
| 16 | |
|---|
| 17 | using namespace osgDB; |
|---|
| 18 | |
|---|
| 19 | void AuthenticationMap::addAuthenticationDetails(const std::string& path, AuthenticationDetails* details) |
|---|
| 20 | { |
|---|
| 21 | _authenticationMap[path] = details; |
|---|
| 22 | } |
|---|
| 23 | |
|---|
| 24 | const AuthenticationDetails* AuthenticationMap::getAuthenticationDetails(const std::string& path) const |
|---|
| 25 | { |
|---|
| 26 | |
|---|
| 27 | AuthenticationDetailsMap::const_iterator itr = _authenticationMap.find(path); |
|---|
| 28 | if (itr != _authenticationMap.end()) return itr->second.get(); |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | std::string basePath = osgDB::getFilePath(path); |
|---|
| 32 | while(!basePath.empty()) |
|---|
| 33 | { |
|---|
| 34 | itr = _authenticationMap.find(basePath); |
|---|
| 35 | if (itr != _authenticationMap.end()) return itr->second.get(); |
|---|
| 36 | |
|---|
| 37 | basePath = osgDB::getFilePath(basePath); |
|---|
| 38 | } |
|---|
| 39 | return 0; |
|---|
| 40 | } |
|---|