cmDocumentationSection.cxx 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. #include "cmDocumentationSection.h"
  11. //----------------------------------------------------------------------------
  12. void cmDocumentationSection::Append(const char *data[][3])
  13. {
  14. int i = 0;
  15. while(data[i][1])
  16. {
  17. this->Entries.push_back(cmDocumentationEntry(data[i][0],
  18. data[i][1],
  19. data[i][2]));
  20. data += 1;
  21. }
  22. }
  23. //----------------------------------------------------------------------------
  24. void cmDocumentationSection::Prepend(const char *data[][3])
  25. {
  26. std::vector<cmDocumentationEntry> tmp;
  27. int i = 0;
  28. while(data[i][1])
  29. {
  30. tmp.push_back(cmDocumentationEntry(data[i][0],
  31. data[i][1],
  32. data[i][2]));
  33. data += 1;
  34. }
  35. this->Entries.insert(this->Entries.begin(),tmp.begin(),tmp.end());
  36. }
  37. //----------------------------------------------------------------------------
  38. void cmDocumentationSection::Append(const char *n, const char *b,
  39. const char *f)
  40. {
  41. this->Entries.push_back(cmDocumentationEntry(n,b,f));
  42. }
  43. #if 0
  44. //----------------------------------------------------------------------------
  45. void cmDocumentationSection::Set(const cmDocumentationEntry* header,
  46. const cmDocumentationEntry* section,
  47. const cmDocumentationEntry* footer)
  48. {
  49. this->Entries.erase(this->Entries.begin(), this->Entries.end());
  50. if(header)
  51. {
  52. for(const cmDocumentationEntry* op = header; op->brief; ++op)
  53. {
  54. this->Entries.push_back(*op);
  55. }
  56. }
  57. if(section)
  58. {
  59. for(const cmDocumentationEntry* op = section; op->brief; ++op)
  60. {
  61. this->Entries.push_back(*op);
  62. }
  63. }
  64. if(footer)
  65. {
  66. for(const cmDocumentationEntry* op = footer; op->brief; ++op)
  67. {
  68. this->Entries.push_back(*op);
  69. }
  70. }
  71. cmDocumentationEntry empty = {0,0,0};
  72. this->Entries.push_back(empty);
  73. }
  74. #endif