46 #include <QtCore/qlist.h> 47 #include <QtCore/qstringlist.h> 119 qWarning(
"addCommand(): nameless command ignored");
123 qWarning(
"addCommand(): groupless command '%s' ignored",
128 qWarning(
"addCommand(): duplicate command '%s' (group '%s') ignored",
132 if (!
d->groups.contains(command->
group())) {
133 qWarning(
"addCommand(): group '%s' for command '%s' is unknown!",
136 d->commands.append(command);
147 qWarning(
"addCommandGroup(): nameless group ignored");
150 if (
d->groups.contains(name)) {
151 qWarning(
"addCommandGroup(): group '%s' already defined",
165 for (
int i = 0; i <
d->commands.size(); ++i) {
182 for (
int i = 0; i <
d->commands.size(); ++i) {
184 result[cmd->
group()].append(cmd);
196 for (
int i = 0; i <
d->commands.size(); ++i) {
210 return d->groups.value(name);
229 for (
int i = 0; i <
d->commands.size(); ++i) {
234 for (
int j = 0; j < names.
size(); ++j) {
virtual QString group() const =0
Returns the group that this console command belongs to.
#define QT_END_NAMESPACE
This macro expands to.
void addCommand(QScriptDebuggerConsoleCommand *command)
Adds the given command.
QScriptDebuggerConsoleCommandManager * q_ptr
int length() const
Returns the number of characters in this string.
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QMap< QString, QList< QScriptDebuggerConsoleCommand * > > commands() const
Returns the commands organized into groups.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
virtual QString name() const =0
Returns the name of this console command.
QStringList completions(const QString &prefix) const
Returns the possible completions for the given prefix.
void append(const T &t)
Inserts value at the end of the list.
QScopedPointer< QScriptDebuggerConsoleCommandManagerPrivate > d_ptr
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
Q_CORE_EXPORT void qWarning(const char *,...)
static const char * data(const QByteArray &arr)
QMap< QString, QScriptDebuggerConsoleCommandGroupData > groups
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
QScriptDebuggerConsoleCommandManager()
void qStableSort(RandomAccessIterator start, RandomAccessIterator end)
QList< QScriptDebuggerConsoleCommand * > commands
QScriptDebuggerConsoleCommand * findCommand(const QString &name) const
Returns the command with the given name if one exists, otherwise returns 0.
The QScriptDebuggerConsoleCommandGroupData class holds data associated with a console command group...
#define Q_DECLARE_PUBLIC(Class)
The QScriptDebuggerConsoleCommand class is the base class of console commands.
QScriptDebuggerConsoleCommandGroupData commandGroupData(const QString &name) const
Returns data associated with the group of the given name.
int size() const
Returns the number of items in the list.
~QScriptDebuggerConsoleCommandManagerPrivate()
QList< QScriptDebuggerConsoleCommand * > commandsInGroup(const QString &name) const
Returns commands in the group of the given name.
QScriptDebuggerConsoleCommandGroupMap commandGroups() const
Returns all command groups.
~QScriptDebuggerConsoleCommandManager()
QScriptDebuggerConsoleCommandManagerPrivate()
#define qPrintable(string)
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
virtual QStringList aliases() const
Returns a list of aliases for this command.
The QList class is a template class that provides lists.
void addCommandGroup(const QString &name, const QScriptDebuggerConsoleCommandGroupData &data)
Registers a command group with the given name and data.