summaryrefslogtreecommitdiff
path: root/cli/options.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-11-28 11:41:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-11-28 11:41:15 +0200
commit36e3bc290d58ad29692a4d594f37a6cb761912c7 (patch)
tree3ebbc1edf910e5168fb819404ecedbf23c95b9d0 /cli/options.ixx
parenta376ccf37122f0768fce8e3c5a16561e01ee2351 (diff)
Use a scanner interface instead of argc/argv
This will allow supporting other sources of options, for example, an option file.
Diffstat (limited to 'cli/options.ixx')
-rw-r--r--cli/options.ixx20
1 files changed, 20 insertions, 0 deletions
diff --git a/cli/options.ixx b/cli/options.ixx
index 60afbda..6fcc80f 100644
--- a/cli/options.ixx
+++ b/cli/options.ixx
@@ -83,6 +83,26 @@ namespace cli
{
return value_;
}
+
+ // argv_scanner
+ //
+ inline argv_scanner::
+ argv_scanner (int argc, char** argv)
+ : i_ (1), argc_ (argc), argv_ (argv)
+ {
+ }
+
+ inline argv_scanner::
+ argv_scanner (int start, int argc, char** argv)
+ : i_ (start), argc_ (argc), argv_ (argv)
+ {
+ }
+
+ inline int argv_scanner::
+ end () const
+ {
+ return i_;
+ }
}
// options