summaryrefslogtreecommitdiffstats
path: root/Source/cmDocumentation.h
diff options
context:
space:
mode:
authorArtur Ryt <artur.ryt@gmail.com>2018-11-30 19:08:50 (GMT)
committerBrad King <brad.king@kitware.com>2019-01-11 19:51:32 (GMT)
commit57862079d8956d30711559eadbf0da31b39917f1 (patch)
tree329a436c1776db39fe1eb440e6bbd6147d1a6d30 /Source/cmDocumentation.h
parent4308eb3d165dfc473182021c12ec877e388f60a2 (diff)
downloadCMake-57862079d8956d30711559eadbf0da31b39917f1.zip
CMake-57862079d8956d30711559eadbf0da31b39917f1.tar.gz
CMake-57862079d8956d30711559eadbf0da31b39917f1.tar.bz2
cmDocumentation: Get rid of raw pointers in AllSections map
Also simplify a lot of logic around adding sections into it. Prefer move sematics over references.
Diffstat (limited to 'Source/cmDocumentation.h')
-rw-r--r--Source/cmDocumentation.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h
index 153bad6..b2ff01a 100644
--- a/Source/cmDocumentation.h
+++ b/Source/cmDocumentation.h
@@ -6,13 +6,13 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmDocumentationFormatter.h"
+#include "cmDocumentationSection.h"
#include <iosfwd>
#include <map>
#include <string>
#include <vector>
-class cmDocumentationSection;
struct cmDocumentationEntry;
/** Class to generate documentation. */
@@ -21,8 +21,6 @@ class cmDocumentation : public cmDocumentationEnums
public:
cmDocumentation();
- ~cmDocumentation();
-
/**
* Check command line arguments for documentation options. Returns
* true if documentation options are found, and false otherwise.
@@ -52,11 +50,11 @@ public:
/** Set a section of the documentation. Typical sections include Name,
Usage, Description, Options */
- void SetSection(const char* sectionName, cmDocumentationSection* section);
+ void SetSection(const char* sectionName, cmDocumentationSection section);
void SetSection(const char* sectionName,
std::vector<cmDocumentationEntry>& docs);
void SetSection(const char* sectionName, const char* docs[][2]);
- void SetSections(std::map<std::string, cmDocumentationSection*>& sections);
+ void SetSections(std::map<std::string, cmDocumentationSection> sections);
/** Add the documentation to the beginning/end of the section */
void PrependSection(const char* sectionName, const char* docs[][2]);
@@ -110,7 +108,8 @@ private:
bool ShowGenerators;
std::string NameString;
- std::map<std::string, cmDocumentationSection*> AllSections;
+ std::map<std::string, cmDocumentationSection> AllSections;
+ cmDocumentationSection& SectionAtName(const char* name);
std::string CurrentArgument;