llvm.org GIT mirror llvm / 9b01cc0
Make getDirnameSep a static method (not part of Path's interface). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49354 91177308-0d34-0410-b5e6-96231b3b80d8 Ted Kremenek 12 years ago
4 changed file(s) with 7 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
570570 /// MemoryBuffer::getFile instead.
571571 static void UnMapFilePages(const char *Base, uint64_t FileSize);
572572
573
574 /// @}
575 /// @name Internal methods.
576 /// @{
577 protected:
578 std::string getDirnameCharSep(char Sep) const;
579
580573 /// @}
581574 /// @name Data
582575 /// @{
195195 Paths.push_back(tmpPath);
196196 }
197197
198 std::string Path::getDirnameCharSep(char Sep) const {
198 static std::string getDirnameCharSep(const std::string& path, char Sep) {
199199
200200 if (path.empty())
201201 return ".";
276276 }
277277
278278
279 std::string Path::getDirname() const { return getDirnameCharSep('/'); }
279 std::string Path::getDirname() const {
280 return getDirnameCharSep(path, '/');
281 }
280282
281283 std::string
282284 Path::getBasename() const {
228228 return len > 0 && path[len-1] == '/';
229229 }
230230
231 std::string Path::getDirname() const { return getDirnameCharSep('\\'); }
231 std::string Path::getDirname() const {
232 return getDirnameCharSep(path, '\\');
233 }
232234
233235 std::string
234236 Path::getBasename() const {