summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-10-04 09:31:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-10-04 09:31:37 +0200
commit9f995b41e72b25c0c7ffe8e2568e166d86f27bcc (patch)
tree06a8854080742ca256c3dc4d90b4c910864bf8d4 /cli
parentbeab8baab8a7f727f5ba65ecbd7e11decea18112 (diff)
Add --{hxx,ixx,cxx}-suffix options
Diffstat (limited to 'cli')
-rw-r--r--cli/generator.cxx10
-rw-r--r--cli/options.cli7
-rw-r--r--cli/options.cxx30
-rw-r--r--cli/options.hxx18
-rw-r--r--cli/options.ixx24
5 files changed, 69 insertions, 20 deletions
diff --git a/cli/generator.cxx b/cli/generator.cxx
index 6c766e4..f7a9a1f 100644
--- a/cli/generator.cxx
+++ b/cli/generator.cxx
@@ -77,16 +77,12 @@ generate (options const& ops, semantics::cli_unit& unit, path const& p)
{
bool inl (!ops.suppress_inline ());
- string hxx_suffix (".hxx");
- string ixx_suffix (".ixx");
- string cxx_suffix (".cxx");
-
path file (p.leaf ());
string base (file.base ().string ());
- string hxx_name (base + hxx_suffix);
- string ixx_name (base + ixx_suffix);
- string cxx_name (base + cxx_suffix);
+ string hxx_name (base + ops.hxx_suffix ());
+ string ixx_name (base + ops.ixx_suffix ());
+ string cxx_name (base + ops.cxx_suffix ());
path hxx_path (hxx_name);
path ixx_path (ixx_name);
diff --git a/cli/options.cli b/cli/options.cli
index 3b78646..2ef8738 100644
--- a/cli/options.cli
+++ b/cli/options.cli
@@ -14,6 +14,11 @@ class options
{
bool --help;
bool --version;
- std::string --output-dir;
+
bool --suppress-inline;
+
+ std::string --output-dir;
+ std::string --hxx-suffix = ".hxx";
+ std::string --ixx-suffix = ".ixx";
+ std::string --cxx-suffix = ".cxx";
};
diff --git a/cli/options.cxx b/cli/options.cxx
index c2ad4fd..c38ca35 100644
--- a/cli/options.cxx
+++ b/cli/options.cxx
@@ -167,8 +167,11 @@ options (int argc,
::cli::unknown_mode arg)
: help_ (),
version_ (),
+ suppress_inline_ (),
output_dir_ (),
- suppress_inline_ ()
+ hxx_suffix_ (".hxx"),
+ ixx_suffix_ (".ixx"),
+ cxx_suffix_ (".cxx")
{
_parse (1, argc, argv, opt, arg);
}
@@ -181,8 +184,11 @@ options (int start,
::cli::unknown_mode arg)
: help_ (),
version_ (),
+ suppress_inline_ (),
output_dir_ (),
- suppress_inline_ ()
+ hxx_suffix_ (".hxx"),
+ ixx_suffix_ (".ixx"),
+ cxx_suffix_ (".cxx")
{
_parse (start, argc, argv, opt, arg);
}
@@ -195,8 +201,11 @@ options (int argc,
::cli::unknown_mode arg)
: help_ (),
version_ (),
+ suppress_inline_ (),
output_dir_ (),
- suppress_inline_ ()
+ hxx_suffix_ (".hxx"),
+ ixx_suffix_ (".ixx"),
+ cxx_suffix_ (".cxx")
{
end = _parse (1, argc, argv, opt, arg);
}
@@ -210,8 +219,11 @@ options (int start,
::cli::unknown_mode arg)
: help_ (),
version_ (),
+ suppress_inline_ (),
output_dir_ (),
- suppress_inline_ ()
+ hxx_suffix_ (".hxx"),
+ ixx_suffix_ (".ixx"),
+ cxx_suffix_ (".cxx")
{
end = _parse (start, argc, argv, opt, arg);
}
@@ -230,10 +242,16 @@ struct _cli_options_map_init
&::cli::thunk<options, bool, &options::help_>;
_cli_options_map_["--version"] =
&::cli::thunk<options, bool, &options::version_>;
- _cli_options_map_["--output-dir"] =
- &::cli::thunk<options, std::string, &options::output_dir_>;
_cli_options_map_["--suppress-inline"] =
&::cli::thunk<options, bool, &options::suppress_inline_>;
+ _cli_options_map_["--output-dir"] =
+ &::cli::thunk<options, std::string, &options::output_dir_>;
+ _cli_options_map_["--hxx-suffix"] =
+ &::cli::thunk<options, std::string, &options::hxx_suffix_>;
+ _cli_options_map_["--ixx-suffix"] =
+ &::cli::thunk<options, std::string, &options::ixx_suffix_>;
+ _cli_options_map_["--cxx-suffix"] =
+ &::cli::thunk<options, std::string, &options::cxx_suffix_>;
}
} _cli_options_map_init_;
diff --git a/cli/options.hxx b/cli/options.hxx
index cf92229..2594947 100644
--- a/cli/options.hxx
+++ b/cli/options.hxx
@@ -210,11 +210,20 @@ class options
bool const&
version () const;
+ bool const&
+ suppress_inline () const;
+
std::string const&
output_dir () const;
- bool const&
- suppress_inline () const;
+ std::string const&
+ hxx_suffix () const;
+
+ std::string const&
+ ixx_suffix () const;
+
+ std::string const&
+ cxx_suffix () const;
private:
int
@@ -227,8 +236,11 @@ class options
public:
bool help_;
bool version_;
- std::string output_dir_;
bool suppress_inline_;
+ std::string output_dir_;
+ std::string hxx_suffix_;
+ std::string ixx_suffix_;
+ std::string cxx_suffix_;
};
#include "options.ixx"
diff --git a/cli/options.ixx b/cli/options.ixx
index ac93219..9e15c36 100644
--- a/cli/options.ixx
+++ b/cli/options.ixx
@@ -17,15 +17,33 @@ version () const
return version_;
}
+inline bool const& options::
+suppress_inline () const
+{
+ return suppress_inline_;
+}
+
inline std::string const& options::
output_dir () const
{
return output_dir_;
}
-inline bool const& options::
-suppress_inline () const
+inline std::string const& options::
+hxx_suffix () const
{
- return suppress_inline_;
+ return hxx_suffix_;
+}
+
+inline std::string const& options::
+ixx_suffix () const
+{
+ return ixx_suffix_;
+}
+
+inline std::string const& options::
+cxx_suffix () const
+{
+ return cxx_suffix_;
}