IniConfiguration.h 981 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #ifndef INICONFIGURATION_H
  9. #define INICONFIGURATION_H
  10. #if !defined(Q_MOC_RUN)
  11. #include <QDir>
  12. #include <QString>
  13. #include <QCoreApplication>
  14. #endif
  15. /** Reads the bootstrap file for listening port
  16. */
  17. class IniConfiguration
  18. : public QObject
  19. {
  20. Q_OBJECT
  21. public:
  22. explicit IniConfiguration(QObject* pParent = nullptr);
  23. virtual ~IniConfiguration();
  24. // Singleton pattern:
  25. static const IniConfiguration* Get();
  26. void parseCommandLine(QStringList cmdLine = QCoreApplication::arguments());
  27. void readINIConfigFile(QDir dir = qApp->applicationDirPath());
  28. quint16 listeningPort() const;
  29. void SetListeningPort(quint16 port);
  30. private:
  31. quint16 m_listeningPort;
  32. QString m_userConfigFilePath;
  33. };
  34. #endif // INICONFIGURATION_H