/[svn]/linuxsampler/trunk/src/common/Path.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/common/Path.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1402 by schoenebeck, Thu Oct 11 18:53:29 2007 UTC revision 1403 by iliev, Fri Oct 12 09:12:22 2007 UTC
# Line 161  Path Path::fromPosix(std::string path) { Line 161  Path Path::fromPosix(std::string path) {
161      return result;      return result;
162  }  }
163    
164    Path Path::fromDbPath(std::string path) {
165        Path result;
166        // first split the nodes
167        {
168            int nodeEnd;
169            for (
170                int nodeBegin = path.find_first_not_of('/');
171                nodeBegin != std::string::npos;
172                nodeBegin = path.find_first_not_of('/', nodeEnd)
173            ) {
174                nodeEnd = path.find_first_of('/', nodeBegin);
175    
176                std::string s = (nodeEnd != std::string::npos) ?
177                    path.substr(nodeBegin, nodeEnd - nodeBegin) :
178                    path.substr(nodeBegin);
179    
180                for (int i = 0; i < s.length(); i++) if (s.at(i) == '\0') s.at(i) = '/';
181                result.appendNode(s);
182            }
183        }
184        return result;
185    }
186    
187  } // namespace LinuxSampler  } // namespace LinuxSampler

Legend:
Removed from v.1402  
changed lines
  Added in v.1403

  ViewVC Help
Powered by ViewVC