cmCPackIFWRepository.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmCPackIFWRepository_h
  11. #define cmCPackIFWRepository_h
  12. #include <cmConfigure.h> // IWYU pragma: keep
  13. #include <string>
  14. #include <vector>
  15. class cmCPackIFWGenerator;
  16. class cmXMLWriter;
  17. /** \class cmCPackIFWRepository
  18. * \brief A remote repository to be created CPack IFW generator
  19. */
  20. class cmCPackIFWRepository
  21. {
  22. public:
  23. // Types
  24. enum Action
  25. {
  26. None,
  27. Add,
  28. Remove,
  29. Replace
  30. };
  31. typedef std::vector<cmCPackIFWRepository*> RepositoriesVector;
  32. public:
  33. // Constructor
  34. /**
  35. * Construct repository
  36. */
  37. cmCPackIFWRepository();
  38. public:
  39. // Configuration
  40. /// Internal repository name
  41. std::string Name;
  42. /// Optional update action
  43. Action Update;
  44. /// Is points to a list of available components
  45. std::string Url;
  46. /// Is points to a list that will replaced
  47. std::string OldUrl;
  48. /// Is points to a list that will replace to
  49. std::string NewUrl;
  50. /// With "0" disabling this repository
  51. std::string Enabled;
  52. /// Is used as user on a protected repository
  53. std::string Username;
  54. /// Is password to use on a protected repository
  55. std::string Password;
  56. /// Is optional string to display instead of the URL
  57. std::string DisplayName;
  58. public:
  59. // Internal implementation
  60. bool IsValid() const;
  61. const char* GetOption(const std::string& op) const;
  62. bool IsOn(const std::string& op) const;
  63. bool IsVersionLess(const char* version);
  64. bool IsVersionGreater(const char* version);
  65. bool IsVersionEqual(const char* version);
  66. bool ConfigureFromOptions();
  67. bool PatchUpdatesXml();
  68. void WriteRepositoryConfig(cmXMLWriter& xout);
  69. void WriteRepositoryUpdate(cmXMLWriter& xout);
  70. void WriteRepositoryUpdates(cmXMLWriter& xout);
  71. cmCPackIFWGenerator* Generator;
  72. RepositoriesVector RepositoryUpdate;
  73. std::string Directory;
  74. protected:
  75. void WriteGeneratedByToStrim(cmXMLWriter& xout);
  76. };
  77. #endif // cmCPackIFWRepository_h