Lolly
1.4.28
Loading...
Searching...
No Matches
lolly
system
args.hpp
Go to the documentation of this file.
1
2
/******************************************************************************
3
* MODULE : args.hpp
4
* DESCRIPTION: lolly::system::args like nowide::args
5
* COPYRIGHT : (C) 2024 Darcy Shen
6
*******************************************************************************
7
* This software falls under the GNU general public license version 3 or later.
8
* It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
9
* in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
10
******************************************************************************/
11
12
#include "
string.hpp
"
13
#include <vector>
14
15
namespace
lolly
{
16
namespace
system {
17
#if defined(OS_MINGW) || defined(_WIN32) || defined(_WIN64)
18
class
args {
19
public
:
20
// Fix command line agruments
21
args
(
int
&
argc
,
char
**&
argv
)
22
:
old_argc_
(
argc
),
old_argv_
(
argv
),
old_argc_ptr_
(&
argc
),
23
old_argv_ptr_
(&
argv
) {
24
fix_args
(
argc
,
argv
);
25
}
26
27
// Restore original argc, argv if changed
28
~args
() {
29
if
(
old_argc_ptr_
) *
old_argc_ptr_
=
old_argc_
;
30
if
(
old_argv_ptr_
) *
old_argv_ptr_
=
old_argv_
;
31
}
32
33
private
:
34
void
fix_args
(
int
&
argc
,
char
**&
argv
);
35
36
std::vector<char*>
args_
;
37
std::vector<string>
arg_values_
;
38
39
int
old_argc_
;
40
char
**
old_argv_
;
41
42
int
*
old_argc_ptr_
;
43
char
***
old_argv_ptr_
;
44
};
45
46
#else
47
class
args
{
48
public
:
49
args
(
int
&,
char
**&) {}
50
~args
() {}
51
};
52
#endif
53
}
// namespace system
54
}
// namespace lolly
list
The list class represents a linked list.
Definition
list.hpp:48
list::list
list(T item)
Construct a new list object with a single item.
Definition
list.hpp:137
lolly::system::args
Definition
args.hpp:47
lolly::system::args::args
args(int &, char **&)
Definition
args.hpp:49
lolly::system::args::~args
~args()
Definition
args.hpp:50
lolly
Definition
lolly_tree_bench.cpp:13
string.hpp
Generated by
1.10.0