diff options
Diffstat (limited to 'lldb/source/Host/common/FileSpec.cpp')
-rw-r--r-- | lldb/source/Host/common/FileSpec.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp index 5edec81a7d9..4764169a618 100644 --- a/lldb/source/Host/common/FileSpec.cpp +++ b/lldb/source/Host/common/FileSpec.cpp @@ -702,6 +702,33 @@ FileSpec::GetPath(char *path, size_t path_max_len) const return 0; } +void +FileSpec::GetPath (std::string &path) const +{ + const char *dirname = m_directory.GetCString(); + const char *filename = m_filename.GetCString(); + path.clear(); + if (dirname) + { + path.append (dirname); + if (filename) + path.append ("/"); + } + if (filename) + { + path.append (filename); + } +} + + +std::string& +FileSpec::GetPath (void) const +{ + std::string path; + GetPath (path); + return path; +} + ConstString FileSpec::GetFileNameExtension () const { @@ -1032,5 +1059,3 @@ FileSpec::IsRelativeToCurrentWorkingDirectory () const } return false; } - - |