From a22e3dc68dd88eb047bfd9716e5cb780c95a3cea Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 1 Feb 2016 12:08:06 +0200 Subject: Add support for link transformation (--link-regex) --- cli/context.hxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'cli/context.hxx') diff --git a/cli/context.hxx b/cli/context.hxx index cdc0aa5..b33bfef 100644 --- a/cli/context.hxx +++ b/cli/context.hxx @@ -9,9 +9,11 @@ #include #include #include +#include #include #include // std::size_t +#include #include #include @@ -52,6 +54,14 @@ public: typedef ::usage usage_type; typedef ::class_doc class_doc_type; + // Regex. + // + typedef cutl::re::regex regex; + typedef cutl::re::regexsub regexsub; + typedef cutl::re::format regex_format; + + typedef std::vector regex_mapping; + private: struct data; cutl::shared_ptr data_; @@ -76,12 +86,16 @@ public: typedef std::set keyword_set_type; keyword_set_type const& keyword_set; + regex_mapping const& link_regex; + private: struct data { string inl_; string cli_; keyword_set_type keyword_set_; + + regex_mapping link_regex_; }; public: @@ -90,6 +104,9 @@ public: string escape (string const&) const; + string + process_link_target (const string&); + // Translate and format the documentation string. Translate converts // the -style constructs to \i{arg}. Format converts the string // to the output format. -- cgit v1.1