cmCPackIFWRepository.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmCPackIFWRepository_h
  4. #define cmCPackIFWRepository_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include "cmCPackIFWCommon.h"
  7. #include <string>
  8. #include <vector>
  9. class cmXMLWriter;
  10. /** \class cmCPackIFWRepository
  11. * \brief A remote repository to be created CPack IFW generator
  12. */
  13. class cmCPackIFWRepository : public cmCPackIFWCommon
  14. {
  15. public:
  16. // Types
  17. enum Action
  18. {
  19. None,
  20. Add,
  21. Remove,
  22. Replace
  23. };
  24. typedef std::vector<cmCPackIFWRepository*> RepositoriesVector;
  25. public:
  26. // Constructor
  27. /**
  28. * Construct repository
  29. */
  30. cmCPackIFWRepository();
  31. public:
  32. // Configuration
  33. /// Internal repository name
  34. std::string Name;
  35. /// Optional update action
  36. Action Update;
  37. /// Is points to a list of available components
  38. std::string Url;
  39. /// Is points to a list that will replaced
  40. std::string OldUrl;
  41. /// Is points to a list that will replace to
  42. std::string NewUrl;
  43. /// With "0" disabling this repository
  44. std::string Enabled;
  45. /// Is used as user on a protected repository
  46. std::string Username;
  47. /// Is password to use on a protected repository
  48. std::string Password;
  49. /// Is optional string to display instead of the URL
  50. std::string DisplayName;
  51. public:
  52. // Internal implementation
  53. bool IsValid() const;
  54. bool ConfigureFromOptions();
  55. bool PatchUpdatesXml();
  56. void WriteRepositoryConfig(cmXMLWriter& xout);
  57. void WriteRepositoryUpdate(cmXMLWriter& xout);
  58. void WriteRepositoryUpdates(cmXMLWriter& xout);
  59. RepositoriesVector RepositoryUpdate;
  60. std::string Directory;
  61. };
  62. #endif // cmCPackIFWRepository_h