LLDB mainline
lldb_private::ScriptInterpreter::SanitizedScriptingModuleName Class Reference

Holds an lldb_private::Module name and a "sanitized" version of it for the purposes of loading a script of that name by the relevant ScriptInterpreter. More...

#include <ScriptInterpreter.h>

Public Member Functions

 SanitizedScriptingModuleName (std::string name, std::string sanitized_name, std::string conflicting_keyword)
bool IsKeyword () const
 Returns true if this name is a keyword in the associated scripting language.
bool RequiredSanitization () const
 Returns true if the original name has been sanitized (i.e., required changes).
llvm::StringRef GetSanitizedName () const
llvm::StringRef GetOriginalName () const
llvm::StringRef GetConflictingKeyword () const

Private Attributes

std::string m_original_name
std::string m_sanitized_name
std::string m_conflicting_keyword
 If the m_sanitized_name conflicts with a keyword for the ScriptInterpreter language associated with this SanitizedScriptingModuleName, is set to the conflicting keyword.

Detailed Description

Holds an lldb_private::Module name and a "sanitized" version of it for the purposes of loading a script of that name by the relevant ScriptInterpreter.

E.g., for Python the sanitized name can't include:

  • Special characters: '-', ' ', '.'
  • Python keywords

Definition at line 582 of file ScriptInterpreter.h.

Constructor & Destructor Documentation

◆ SanitizedScriptingModuleName()

lldb_private::ScriptInterpreter::SanitizedScriptingModuleName::SanitizedScriptingModuleName ( std::string name,
std::string sanitized_name,
std::string conflicting_keyword )
inline

Definition at line 584 of file ScriptInterpreter.h.

References m_conflicting_keyword, m_original_name, and m_sanitized_name.

Member Function Documentation

◆ GetConflictingKeyword()

llvm::StringRef lldb_private::ScriptInterpreter::SanitizedScriptingModuleName::GetConflictingKeyword ( ) const
inline

◆ GetOriginalName()

llvm::StringRef lldb_private::ScriptInterpreter::SanitizedScriptingModuleName::GetOriginalName ( ) const
inline

◆ GetSanitizedName()

llvm::StringRef lldb_private::ScriptInterpreter::SanitizedScriptingModuleName::GetSanitizedName ( ) const
inline

◆ IsKeyword()

bool lldb_private::ScriptInterpreter::SanitizedScriptingModuleName::IsKeyword ( ) const
inline

Returns true if this name is a keyword in the associated scripting language.

Definition at line 592 of file ScriptInterpreter.h.

References m_conflicting_keyword.

Referenced by lldb_private::Platform::WarnIfInvalidUnsanitizedScriptExists().

◆ RequiredSanitization()

bool lldb_private::ScriptInterpreter::SanitizedScriptingModuleName::RequiredSanitization ( ) const
inline

Returns true if the original name has been sanitized (i.e., required changes).

Definition at line 596 of file ScriptInterpreter.h.

References m_original_name, and m_sanitized_name.

Referenced by lldb_private::Platform::WarnIfInvalidUnsanitizedScriptExists().

Member Data Documentation

◆ m_conflicting_keyword

std::string lldb_private::ScriptInterpreter::SanitizedScriptingModuleName::m_conflicting_keyword
private

If the m_sanitized_name conflicts with a keyword for the ScriptInterpreter language associated with this SanitizedScriptingModuleName, is set to the conflicting keyword.

Empty otherwise.

Definition at line 614 of file ScriptInterpreter.h.

Referenced by GetConflictingKeyword(), IsKeyword(), and SanitizedScriptingModuleName().

◆ m_original_name

std::string lldb_private::ScriptInterpreter::SanitizedScriptingModuleName::m_original_name
private

◆ m_sanitized_name

std::string lldb_private::ScriptInterpreter::SanitizedScriptingModuleName::m_sanitized_name
private

The documentation for this class was generated from the following file: