aboutsummaryrefslogtreecommitdiff
path: root/source/Core/FileSpecList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Core/FileSpecList.cpp')
-rw-r--r--source/Core/FileSpecList.cpp42
1 files changed, 16 insertions, 26 deletions
diff --git a/source/Core/FileSpecList.cpp b/source/Core/FileSpecList.cpp
index 4b1c991c6be4..cef1bfba41b0 100644
--- a/source/Core/FileSpecList.cpp
+++ b/source/Core/FileSpecList.cpp
@@ -6,35 +6,28 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+
#include "lldb/Core/FileSpecList.h"
-#include "lldb/Core/Stream.h"
+
+// C Includes
+// C++ Includes
#include <algorithm>
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/Stream.h"
+
using namespace lldb_private;
using namespace std;
-//------------------------------------------------------------------
-// Default constructor
-//------------------------------------------------------------------
FileSpecList::FileSpecList() :
m_files()
{
}
-//------------------------------------------------------------------
-// Copy constructor
-//------------------------------------------------------------------
-FileSpecList::FileSpecList(const FileSpecList& rhs) :
- m_files(rhs.m_files)
-{
-}
+FileSpecList::FileSpecList(const FileSpecList& rhs) = default;
-//------------------------------------------------------------------
-// Destructor
-//------------------------------------------------------------------
-FileSpecList::~FileSpecList()
-{
-}
+FileSpecList::~FileSpecList() = default;
//------------------------------------------------------------------
// Assignment operator
@@ -104,7 +97,7 @@ FileSpecList::Dump(Stream *s, const char *separator_cstr) const
// "file_spec" starting "start_idx" entries into the file spec list.
//
// Returns the valid index of the file that matches "file_spec" if
-// it is found, else UINT32_MAX is returned.
+// it is found, else std::numeric_limits<uint32_t>::max() is returned.
//------------------------------------------------------------------
size_t
FileSpecList::FindFileIndex (size_t start_idx, const FileSpec &file_spec, bool full, bool remove_dots) const
@@ -119,7 +112,8 @@ FileSpecList::FindFileIndex (size_t start_idx, const FileSpec &file_spec, bool f
{
if (compare_filename_only)
{
- if (m_files[idx].GetFilename() == file_spec.GetFilename())
+ if (ConstString::Equals(m_files[idx].GetFilename(), file_spec.GetFilename(),
+ file_spec.IsCaseSensitive() || m_files[idx].IsCaseSensitive()))
return idx;
}
else
@@ -140,7 +134,6 @@ FileSpecList::FindFileIndex (size_t start_idx, const FileSpec &file_spec, bool f
const FileSpec &
FileSpecList::GetFileSpecAtIndex(size_t idx) const
{
-
if (idx < m_files.size())
return m_files[idx];
static FileSpec g_empty_file_spec;
@@ -152,7 +145,7 @@ FileSpecList::GetFileSpecPointerAtIndex(size_t idx) const
{
if (idx < m_files.size())
return &m_files[idx];
- return NULL;
+ return nullptr;
}
//------------------------------------------------------------------
@@ -207,26 +200,23 @@ FileSpecList::GetFilesMatchingPartialPath (const char *path, bool dir_okay, File
else if (type == FileSpec::eFileTypeDirectory)
{
// Fill the match list with all the files in the directory:
-
}
else
{
return 0;
}
-
}
else
{
ConstString dir_name = path_spec.GetDirectory();
- Constring file_name = GetFilename();
- if (dir_name == NULL)
+ ConstString file_name = GetFilename();
+ if (dir_name == nullptr)
{
// Match files in the CWD.
}
else
{
// Match files in the given directory:
-
}
}
#endif