cmCPackIFWRepository.h 1.6 KB

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