diff options
Diffstat (limited to 'Source/cmDocumentation.h')
-rw-r--r-- | Source/cmDocumentation.h | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h index 11bef16..e180f60 100644 --- a/Source/cmDocumentation.h +++ b/Source/cmDocumentation.h @@ -33,7 +33,7 @@ class cmDocumentation: public cmDocumentationEnums { public: cmDocumentation(); - + ~cmDocumentation(); /** @@ -51,18 +51,18 @@ public: typedef std::list<documentedModuleSectionPair_t> documentedModulesList_t; // High-level interface for standard documents: - + /** * Check command line arguments for documentation options. Returns * true if documentation options are found, and false otherwise. * When true is returned, PrintRequestedDocumentation should be - * called. exitOpt can be used for things like cmake -E, so that + * called. exitOpt can be used for things like cmake -E, so that * all arguments after the -E are ignored and not searched for * help arguments. */ - bool CheckOptions(int argc, const char* const* argv, + bool CheckOptions(int argc, const char* const* argv, const char* exitOpt =0); - + /** * Print help requested on the command line. Call after * CheckOptions returns true. Returns true on success, and false @@ -70,12 +70,12 @@ public: * command line cannot be written. */ bool PrintRequestedDocumentation(std::ostream& os); - + /** Print help of the given type. */ bool PrintDocumentation(Type ht, std::ostream& os, const char* docname=0); void SetShowGenerators(bool showGen) { this->ShowGenerators = showGen; } - + /** Set the program name for standard document generation. */ void SetName(const char* name); @@ -108,8 +108,8 @@ public: * Print documentation in the given form. All previously added * sections will be generated. */ - void Print(Form f, std::ostream& os); - + void Print(Form f, int manSection, std::ostream& os); + /** * Print documentation in the current form. All previously added * sections will be generated. @@ -125,15 +125,16 @@ public: void SetSeeAlsoList(const char *data[][3]); /** Clear all previously added sections of help. */ - void ClearSections(); - + void ClearSections(); + /** Set cmake root so we can find installed files */ void SetCMakeRoot(const char* root) { this->CMakeRoot = root;} /** Set CMAKE_MODULE_PATH so we can find additional cmake modules */ void SetCMakeModulePath(const char* path) { this->CMakeModulePath = path;} - - static Form GetFormFromFilename(const std::string& filename); + + static Form GetFormFromFilename(const std::string& filename, + int* ManSection); /** Add common (to all tools) documentation section(s) */ void addCommonStandardDocSections(); @@ -190,13 +191,13 @@ public: std::vector<cmDocumentationEntry>& commands, cmake* cm); private: - void SetForm(Form f); + void SetForm(Form f, int manSection); void SetDocName(const char* docname); - bool CreateSingleModule(const char* fname, + bool CreateSingleModule(const char* fname, const char* moduleName, cmDocumentationSection &sec); - void CreateModuleDocsForDir(cmsys::Directory& dir, + void CreateModuleDocsForDir(cmsys::Directory& dir, cmDocumentationSection &moduleSection); bool CreateModulesSection(); bool CreateCustomModulesSection(); @@ -236,7 +237,7 @@ private: std::string NameString; std::string DocName; std::map<std::string,cmDocumentationSection*> AllSections; - + std::string SeeAlsoString; std::string CMakeRoot; std::string CMakeModulePath; @@ -247,11 +248,12 @@ private: struct RequestedHelpItem { - RequestedHelpItem():HelpForm(TextForm), HelpType(None) {} + RequestedHelpItem():HelpForm(TextForm), HelpType(None), ManSection(1) {} cmDocumentationEnums::Form HelpForm; cmDocumentationEnums::Type HelpType; std::string Filename; std::string Argument; + int ManSection; }; std::vector<RequestedHelpItem> RequestedHelpItems; |