Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
b54c3372
Commit
b54c3372
authored
Mar 22, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add overload to parse with message + file name
parent
f9409ea7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
libcaf_core/caf/actor_system_config.hpp
libcaf_core/caf/actor_system_config.hpp
+9
-4
libcaf_core/src/actor_system_config.cpp
libcaf_core/src/actor_system_config.cpp
+8
-0
No files found.
libcaf_core/caf/actor_system_config.hpp
View file @
b54c3372
...
@@ -115,6 +115,12 @@ public:
...
@@ -115,6 +115,12 @@ public:
// -- modifiers --------------------------------------------------------------
// -- modifiers --------------------------------------------------------------
/// Parses `args` as tuple of strings containing CLI options and tries to
/// open `ini_file_cstr` as INI formatted config file. The parsers tries to
/// open `caf-application.ini` if `ini_file_cstr` is `nullptr`.
actor_system_config
&
parse
(
message
&
args
,
const
char
*
ini_file_cstr
=
nullptr
);
/// Parses `args` as tuple of strings containing CLI options
/// Parses `args` as tuple of strings containing CLI options
/// and `ini_stream` as INI formatted input stream.
/// and `ini_stream` as INI formatted input stream.
actor_system_config
&
parse
(
message
&
args
,
std
::
istream
&
ini
);
actor_system_config
&
parse
(
message
&
args
,
std
::
istream
&
ini
);
...
@@ -123,10 +129,9 @@ public:
...
@@ -123,10 +129,9 @@ public:
/// `ini_stream` as INI formatted input stream.
/// `ini_stream` as INI formatted input stream.
actor_system_config
&
parse
(
int
argc
,
char
**
argv
,
std
::
istream
&
ini
);
actor_system_config
&
parse
(
int
argc
,
char
**
argv
,
std
::
istream
&
ini
);
/// Parses the CLI options `{argc, argv}` and
/// Parses the CLI options `{argc, argv}` and tries to open `ini_file_cstr`
/// tries to open `config_file_name` as INI formatted config file.
/// as INI formatted config file. The parsers tries to open
/// The parsers tries to open `caf-application.ini` if `config_file_name`
/// `caf-application.ini` if `ini_file_cstr` is `nullptr`.
/// is `nullptr`.
actor_system_config
&
parse
(
int
argc
,
char
**
argv
,
actor_system_config
&
parse
(
int
argc
,
char
**
argv
,
const
char
*
ini_file_cstr
=
nullptr
);
const
char
*
ini_file_cstr
=
nullptr
);
...
...
libcaf_core/src/actor_system_config.cpp
View file @
b54c3372
...
@@ -304,6 +304,14 @@ actor_system_config& actor_system_config::parse(int argc, char** argv,
...
@@ -304,6 +304,14 @@ actor_system_config& actor_system_config::parse(int argc, char** argv,
return
parse
(
args
,
ini
);
return
parse
(
args
,
ini
);
}
}
actor_system_config
&
actor_system_config
::
parse
(
message
&
args
,
const
char
*
ini_file_cstr
)
{
if
(
ini_file_cstr
==
nullptr
)
ini_file_cstr
=
"caf-application.ini"
;
std
::
ifstream
ini
{
ini_file_cstr
};
return
parse
(
args
,
ini
);
}
actor_system_config
&
actor_system_config
::
parse
(
message
&
args
,
actor_system_config
&
actor_system_config
::
parse
(
message
&
args
,
std
::
istream
&
ini
)
{
std
::
istream
&
ini
)
{
// (2) content of the INI file overrides hard-coded defaults
// (2) content of the INI file overrides hard-coded defaults
...
...
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