Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef APPLICATIONHELP_H
00028 #define APPLICATIONHELP_H
00029
00030 #include <list>
00031 #include <string>
00032
00033 #include "GpCoreToolsDLLExport.h"
00034
00035 namespace GpCoreTools {
00036
00037 class GPCORETOOLS_EXPORT ApplicationHelp
00038 {
00039 public:
00040 ApplicationHelp();
00041 ~ApplicationHelp();
00042
00043 void exec(const char * group=0);
00044
00045 void addGroup(const char * title, const char * section);
00046 void addOption(const char * option, const char * comments);
00047 void setOptionSummary(const char * optionSummary) {_optionSummary=optionSummary;}
00048 void setComments(const char * comments) {_comments=comments;}
00049 void setSeeAlso(const char * seeAlso) {_seeAlso=seeAlso;}
00050 void addExample(const char * command, const char * comments);
00051
00052 std::list<const char *> sections();
00053 static void print(std::string p, const std::string& linePrefix="", int indent=0);
00054 static std::string getLine(std::string& text, int maxLength, bool * newLine=0);
00055 private:
00056 struct Option {
00057 std::string option;
00058 std::string comments;
00059 };
00060 struct OptionGroup {
00061 std::list<Option> options;
00062 std::string title;
00063 std::string section;
00064 };
00065 struct Example {
00066 std::string command;
00067 std::string comments;
00068 };
00069 std::list<OptionGroup> _options;
00070 std::list<Example> _examples;
00071 std::string _optionSummary;
00072 std::string _comments;
00073 std::string _seeAlso;
00074
00075 void print(const OptionGroup& g);
00076 void execHtml();
00077 static std::string getCustomIndent(std::string& text);
00078 };
00079
00080 }
00081
00082 #endif // APPLICATIONHELP_H