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.

Environments.h 960B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef ENVIRONMENTS_H
  2. #define ENVIRONMENTS_H
  3. #include <QObject>
  4. #include <QList>
  5. struct stEnvironment{
  6. stEnvironment(const QString &key, const QString &value) : key(key), value(value){}
  7. stEnvironment(const QString &unparsed);
  8. QString key;
  9. QString value;
  10. };
  11. class Environments : public QObject
  12. {
  13. Q_OBJECT
  14. public:
  15. explicit Environments(bool includeSystem = true, QObject *parent = nullptr);
  16. explicit Environments(QStringList envs, bool includeSystem = true, QObject *parent = nullptr);
  17. virtual void addEnvironment(const QString &key, const QString &value);
  18. virtual void addEnvironment(const stEnvironment &env);
  19. virtual void modEnvironment(const QString &key, const QString &value);
  20. virtual void modEnvironment(const stEnvironment &env);
  21. virtual QString &environmentValue(const QString &key);
  22. QString &operator[](const QString &key);
  23. virtual QStringList environments();
  24. protected:
  25. QList<stEnvironment> _envs;
  26. };
  27. #endif // ENVIRONMENTS_H