Imported Upstream version 2.8.9
[platform/upstream/cmake.git] / Source / cmDocumentationSection.cxx
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
8   This software is distributed WITHOUT ANY WARRANTY; without even the
9   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10   See the License for more information.
11 ============================================================================*/
12 #include "cmDocumentationSection.h"
13
14
15 //----------------------------------------------------------------------------
16 void cmDocumentationSection::Append(const char *data[][3])
17 {
18   int i = 0;
19   while(data[i][1])
20     {
21     this->Entries.push_back(cmDocumentationEntry(data[i][0],
22                                                  data[i][1],
23                                                  data[i][2]));
24     data += 1;
25     }
26 }
27
28 //----------------------------------------------------------------------------
29 void cmDocumentationSection::Prepend(const char *data[][3])
30 {
31   std::vector<cmDocumentationEntry> tmp;
32   int i = 0;
33   while(data[i][1])
34     {
35     tmp.push_back(cmDocumentationEntry(data[i][0],
36                                        data[i][1],
37                                        data[i][2]));
38     data += 1;
39     }
40   this->Entries.insert(this->Entries.begin(),tmp.begin(),tmp.end());
41 }
42
43 //----------------------------------------------------------------------------
44 void cmDocumentationSection::Append(const char *n, const char *b,
45                                     const char *f)
46 {
47   this->Entries.push_back(cmDocumentationEntry(n,b,f));
48 }
49
50 #if 0
51 //----------------------------------------------------------------------------
52 void cmDocumentationSection::Set(const cmDocumentationEntry* header,
53                                  const cmDocumentationEntry* section,
54                                  const cmDocumentationEntry* footer)
55 {
56   this->Entries.erase(this->Entries.begin(), this->Entries.end());
57   if(header)
58     {
59     for(const cmDocumentationEntry* op = header; op->brief; ++op)
60       {
61       this->Entries.push_back(*op);
62       }
63     }
64   if(section)
65     {
66     for(const cmDocumentationEntry* op = section; op->brief; ++op)
67       {
68       this->Entries.push_back(*op);
69       }
70     }
71   if(footer)
72     {
73     for(const cmDocumentationEntry* op = footer; op->brief; ++op)
74       {
75       this->Entries.push_back(*op);
76       }
77     }
78   cmDocumentationEntry empty = {0,0,0};
79   this->Entries.push_back(empty);
80 }
81 #endif