003 File Manager
Current Path:
/usr/src/contrib/llvm-project/lldb/source/Core
usr
/
src
/
contrib
/
llvm-project
/
lldb
/
source
/
Core
/
📁
..
📄
Address.cpp
(34.46 KB)
📄
AddressRange.cpp
(6.35 KB)
📄
AddressResolver.cpp
(1.15 KB)
📄
AddressResolverFileLine.cpp
(2.99 KB)
📄
AddressResolverName.cpp
(6.52 KB)
📄
Communication.cpp
(14.89 KB)
📄
CoreProperties.td
(9.46 KB)
📄
Debugger.cpp
(56.35 KB)
📄
Disassembler.cpp
(45.47 KB)
📄
DumpDataExtractor.cpp
(26.28 KB)
📄
DumpRegisterValue.cpp
(2.88 KB)
📄
DynamicLoader.cpp
(8.11 KB)
📄
EmulateInstruction.cpp
(19.28 KB)
📄
FileLineResolver.cpp
(2.85 KB)
📄
FileSpecList.cpp
(4.02 KB)
📄
FormatEntity.cpp
(83.74 KB)
📄
Highlighter.cpp
(2.91 KB)
📄
IOHandler.cpp
(18.81 KB)
📄
IOHandlerCursesGUI.cpp
(126.73 KB)
📄
Mangled.cpp
(14.82 KB)
📄
Module.cpp
(60.79 KB)
📄
ModuleChild.cpp
(872 B)
📄
ModuleList.cpp
(35.29 KB)
📄
Opcode.cpp
(3.79 KB)
📄
PluginManager.cpp
(52.59 KB)
📄
RichManglingContext.cpp
(5.2 KB)
📄
SearchFilter.cpp
(27.24 KB)
📄
Section.cpp
(19.21 KB)
📄
SourceManager.cpp
(23.03 KB)
📄
StreamAsynchronousIO.cpp
(1.11 KB)
📄
StreamFile.cpp
(1.71 KB)
📄
UserSettingsController.cpp
(3.76 KB)
📄
Value.cpp
(22.68 KB)
📄
ValueObject.cpp
(115.6 KB)
📄
ValueObjectCast.cpp
(3.12 KB)
📄
ValueObjectChild.cpp
(9.28 KB)
📄
ValueObjectConstResult.cpp
(11.81 KB)
📄
ValueObjectConstResultCast.cpp
(2.05 KB)
📄
ValueObjectConstResultChild.cpp
(2.65 KB)
📄
ValueObjectConstResultImpl.cpp
(6.26 KB)
📄
ValueObjectDynamicValue.cpp
(12.25 KB)
📄
ValueObjectList.cpp
(3.31 KB)
📄
ValueObjectMemory.cpp
(8.3 KB)
📄
ValueObjectRegister.cpp
(9.77 KB)
📄
ValueObjectSyntheticFilter.cpp
(13.73 KB)
📄
ValueObjectVariable.cpp
(14.44 KB)
Editing: FileSpecList.cpp
//===-- FileSpecList.cpp --------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "lldb/Core/FileSpecList.h" #include "lldb/Utility/ConstString.h" #include "lldb/Utility/Stream.h" #include <utility> #include <stdint.h> using namespace lldb_private; using namespace std; FileSpecList::FileSpecList() : m_files() {} FileSpecList::~FileSpecList() = default; // Append the "file_spec" to the end of the file spec list. void FileSpecList::Append(const FileSpec &file_spec) { m_files.push_back(file_spec); } // Only append the "file_spec" if this list doesn't already contain it. // // Returns true if "file_spec" was added, false if this list already contained // a copy of "file_spec". bool FileSpecList::AppendIfUnique(const FileSpec &file_spec) { collection::iterator end = m_files.end(); if (find(m_files.begin(), end, file_spec) == end) { m_files.push_back(file_spec); return true; } return false; } // Clears the file list. void FileSpecList::Clear() { m_files.clear(); } // Dumps the file list to the supplied stream pointer "s". void FileSpecList::Dump(Stream *s, const char *separator_cstr) const { collection::const_iterator pos, end = m_files.end(); for (pos = m_files.begin(); pos != end; ++pos) { pos->Dump(s->AsRawOstream()); if (separator_cstr && ((pos + 1) != end)) s->PutCString(separator_cstr); } } // Find the index of the file in the file spec list that matches "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 std::numeric_limits<uint32_t>::max() is returned. size_t FileSpecList::FindFileIndex(size_t start_idx, const FileSpec &file_spec, bool full) const { const size_t num_files = m_files.size(); // When looking for files, we will compare only the filename if the FILE_SPEC // argument is empty bool compare_filename_only = file_spec.GetDirectory().IsEmpty(); for (size_t idx = start_idx; idx < num_files; ++idx) { if (compare_filename_only) { if (ConstString::Equals( m_files[idx].GetFilename(), file_spec.GetFilename(), file_spec.IsCaseSensitive() || m_files[idx].IsCaseSensitive())) return idx; } else { if (FileSpec::Equal(m_files[idx], file_spec, full)) return idx; } } // We didn't find the file, return an invalid index return UINT32_MAX; } // Returns the FileSpec object at index "idx". If "idx" is out of range, then // an empty FileSpec object will be returned. const FileSpec &FileSpecList::GetFileSpecAtIndex(size_t idx) const { if (idx < m_files.size()) return m_files[idx]; static FileSpec g_empty_file_spec; return g_empty_file_spec; } const FileSpec *FileSpecList::GetFileSpecPointerAtIndex(size_t idx) const { if (idx < m_files.size()) return &m_files[idx]; return nullptr; } // Return the size in bytes that this object takes in memory. This returns the // size in bytes of this object's member variables and any FileSpec objects its // member variables contain, the result doesn't not include the string values // for the directories any filenames as those are in shared string pools. size_t FileSpecList::MemorySize() const { size_t mem_size = sizeof(FileSpecList); collection::const_iterator pos, end = m_files.end(); for (pos = m_files.begin(); pos != end; ++pos) { mem_size += pos->MemorySize(); } return mem_size; } // Return the number of files in the file spec list. size_t FileSpecList::GetSize() const { return m_files.size(); } size_t FileSpecList::GetFilesMatchingPartialPath(const char *path, bool dir_okay, FileSpecList &matches) { return 0; }
Upload File
Create Folder