Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
7f9fbba5
Commit
7f9fbba5
authored
Nov 12, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turned the cmd_line_parser into a single implementation component (from the
user perspective anyway).
parent
f7165919
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
92 deletions
+31
-92
cmd_line_parser.h
dlib/cmd_line_parser.h
+29
-25
cmd_line_parser_check_1.h
dlib/cmd_line_parser/cmd_line_parser_check_1.h
+1
-1
cmd_line_parser_check_abstract.h
dlib/cmd_line_parser/cmd_line_parser_check_abstract.h
+0
-0
cmd_line_parser_kernel_abstract.h
dlib/cmd_line_parser/cmd_line_parser_kernel_abstract.h
+0
-0
cmd_line_parser_print_1.h
dlib/cmd_line_parser/cmd_line_parser_print_1.h
+1
-1
cmd_line_parser_print_abstract.h
dlib/cmd_line_parser/cmd_line_parser_print_abstract.h
+0
-65
No files found.
dlib/cmd_line_parser.h
View file @
7f9fbba5
...
...
@@ -19,13 +19,19 @@
namespace
dlib
{
// ----------------------------------------------------------------------------------------
template
<
typename
charT
>
class
cmd_line_parser
class
impl_
cmd_line_parser
{
cmd_line_parser
()
{}
/*!
This class is basically just a big templated typedef for building
a complete command line parser type out of all the parts it needs.
!*/
impl_cmd_line_parser
()
{}
typedef
typename
sequence
<
std
::
basic_string
<
charT
>
>::
kernel_2a
sequence_2a
;
typedef
typename
sequence
<
std
::
basic_string
<
charT
>*>::
kernel_2a
psequence_2a
;
...
...
@@ -33,36 +39,34 @@ namespace dlib
public
:
//----------- kernels ---------------
// kernel_1a
typedef
cmd_line_parser_kernel_1
<
charT
,
map_1a_string
,
sequence_2a
,
psequence_2a
>
kernel_1a
;
typedef
cmd_line_parser_kernel_c
<
kernel_1a
>
kernel_1a_c
;
typedef
cmd_line_parser_kernel_1
<
charT
,
map_1a_string
,
sequence_2a
,
psequence_2a
>
kernel_1a
;
typedef
cmd_line_parser_kernel_c
<
kernel_1a
>
kernel_1a_c
;
typedef
cmd_line_parser_print_1
<
kernel_1a_c
>
print_1a_c
;
typedef
cmd_line_parser_check_c
<
cmd_line_parser_check_1
<
print_1a_c
>
>
check_1a_c
;
};
// ----------------------------------------------------------------------------------------
//----------- extensions ---------------
// print_1 extend kernel_1a
typedef
cmd_line_parser_print_1
<
kernel_1a
>
print_1a
;
typedef
cmd_line_parser_print_1
<
kernel_1a_c
>
print_1a_c
;
// check_1 extend print_1a
typedef
cmd_line_parser_check_1
<
print_1a
>
check_1a
;
typedef
cmd_line_parser_check_c
<
cmd_line_parser_check_1
<
print_1a_c
>
>
check_1a_c
;
template
<
typename
charT
>
class
cmd_line_parser
:
public
impl_cmd_line_parser
<
charT
>::
check_1a_c
{
public
:
// These typedefs are here for backwards compatibility with previous versions of dlib.
typedef
cmd_line_parser
kernel_1a
;
typedef
cmd_line_parser
kernel_1a_c
;
typedef
cmd_line_parser
print_1a
;
typedef
cmd_line_parser
print_1a_c
;
typedef
cmd_line_parser
check_1a
;
typedef
cmd_line_parser
check_1a_c
;
};
// ----------------------------------------------------------------------------------------
typedef
cmd_line_parser
<
char
>
::
check_1a_c
command_line_parser
;
typedef
cmd_line_parser
<
wchar_t
>
::
check_1a_c
wcommand_line_parser
;
typedef
cmd_line_parser
<
char
>
command_line_parser
;
typedef
cmd_line_parser
<
wchar_t
>
wcommand_line_parser
;
// ----------------------------------------------------------------------------------------
...
...
dlib/cmd_line_parser/cmd_line_parser_check_1.h
View file @
7f9fbba5
...
...
@@ -3,7 +3,7 @@
#ifndef DLIB_CMD_LINE_PARSER_CHECk_1_
#define DLIB_CMD_LINE_PARSER_CHECk_1_
#include "cmd_line_parser_
check
_abstract.h"
#include "cmd_line_parser_
kernel
_abstract.h"
#include <sstream>
#include <string>
#include "../string.h"
...
...
dlib/cmd_line_parser/cmd_line_parser_check_abstract.h
deleted
100644 → 0
View file @
f7165919
This diff is collapsed.
Click to expand it.
dlib/cmd_line_parser/cmd_line_parser_kernel_abstract.h
View file @
7f9fbba5
This diff is collapsed.
Click to expand it.
dlib/cmd_line_parser/cmd_line_parser_print_1.h
View file @
7f9fbba5
...
...
@@ -3,7 +3,7 @@
#ifndef DLIB_CMD_LINE_PARSER_PRINt_1_
#define DLIB_CMD_LINE_PARSER_PRINt_1_
#include "cmd_line_parser_
print
_abstract.h"
#include "cmd_line_parser_
kernel
_abstract.h"
#include "../algs.h"
#include "../string.h"
#include <iostream>
...
...
dlib/cmd_line_parser/cmd_line_parser_print_abstract.h
deleted
100644 → 0
View file @
f7165919
// Copyright (C) 2005 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_CMD_LINE_PARSER_PRINt_ABSTRACT_
#ifdef DLIB_CMD_LINE_PARSER_PRINt_ABSTRACT_
#include "cmd_line_parser_kernel_abstract.h"
#include <iosfwd>
namespace
dlib
{
template
<
typename
clp_base
>
class
cmd_line_parser_print
:
public
clp_base
{
/*!
REQUIREMENTS ON CLP_BASE
clp_base is an implementation of cmd_line_parser/cmd_line_parser_kernel_abstract.h
POINTERS AND REFERENCES TO INTERNAL DATA
The print_options() function may invalidate pointers or references to
internal data.
WHAT THIS EXTENSION DOES FOR CMD_LINE_PARSER
This gives a cmd_line_parser object the ability to print its options
in a nice format that fits into a console screen.
!*/
public
:
void
print_options
(
std
::
basic_ostream
<
typename
clp_base
::
char_type
>&
out
)
const
;
/*!
ensures
- prints all the command line options to out.
- #at_start() == true
throws
- any exception.
if an exception is thrown then #at_start() == true but otherwise
it will have no effect on the state of #*this.
!*/
};
template
<
typename
clp_base
>
inline
void
swap
(
cmd_line_parser_print
<
clp_base
>&
a
,
cmd_line_parser_print
<
clp_base
>&
b
)
{
a
.
swap
(
b
);
}
/*!
provides a global swap function
!*/
}
#endif // DLIB_CMD_LINE_PARSER_PRINt_ABSTRACT_
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment