The complete source code of IdealIRC
http://www.idealirc.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
920 B
36 lines
920 B
/*
|
|
* IdealIRC - Internet Relay Chat client
|
|
* Copyright (C) 2021 Tom-Andre Barstad.
|
|
* This software is licensed under the Software Attribution License.
|
|
* See LICENSE for more information.
|
|
*/
|
|
|
|
#ifndef COMMANDDATA_H
|
|
#define COMMANDDATA_H
|
|
|
|
#include <QString>
|
|
#include <QVariant>
|
|
#include <vector>
|
|
#include <functional>
|
|
#include <optional>
|
|
|
|
using PredicateList = std::vector< std::function<
|
|
std::optional<std::string>
|
|
(int& idx, const QString& line)
|
|
>>;
|
|
|
|
class ICommand;
|
|
|
|
class CommandData
|
|
{
|
|
public:
|
|
CommandData(const QString& line, PredicateList argp, bool repeatLastPredicate = false);
|
|
int size() const;
|
|
const std::optional<std::string>& operator[](int idx);
|
|
std::string joinString(char sep) const;
|
|
|
|
private:
|
|
std::vector<std::optional<std::string>> m_l;
|
|
};
|
|
|
|
#endif // COMMANDDATA_H
|
|
|