summaryrefslogtreecommitdiff
path: root/cli/context.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-02-01 12:08:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-02-01 12:08:06 +0200
commita22e3dc68dd88eb047bfd9716e5cb780c95a3cea (patch)
treee991ee32b6155ed262cbcb32b6202907bf4163b1 /cli/context.hxx
parentde673d0b39bff8d8da3d3818de7c79bf0143eb2c (diff)
Add support for link transformation (--link-regex)
Diffstat (limited to 'cli/context.hxx')
-rw-r--r--cli/context.hxx17
1 files changed, 17 insertions, 0 deletions
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 <set>
#include <map>
#include <string>
+#include <vector>
#include <ostream>
#include <cstddef> // std::size_t
+#include <cutl/re.hxx>
#include <cutl/shared-ptr.hxx>
#include <cutl/fs/path.hxx>
@@ -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<regexsub> regex_mapping;
+
private:
struct data;
cutl::shared_ptr<data> data_;
@@ -76,12 +86,16 @@ public:
typedef std::set<string> 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 <arg>-style constructs to \i{arg}. Format converts the string
// to the output format.