Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CL Configurator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BIAS
Configurators
CL Configurator
Commits
588230ea
Commit
588230ea
authored
1 year ago
by
Valerio Pastore
Browse files
Options
Downloads
Patches
Plain Diff
.
parent
d9a305dc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Dev
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/CL_Conf.h
+4
-5
4 additions, 5 deletions
include/CL_Conf.h
src/CL_Conf.cpp
+7
-6
7 additions, 6 deletions
src/CL_Conf.cpp
with
11 additions
and
11 deletions
include/CL_Conf.h
+
4
−
5
View file @
588230ea
...
...
@@ -12,7 +12,7 @@ namespace inaf::oasbo::Configurators {
class
CLConfigurator
:
public
BaseConfigurator
{
protected:
int
argc
;
/**< The number of command line arguments. */
char
**
argv
;
/**< The array of command line arguments. */
char
**
argv
;
/**< The array of command line arguments. */
public:
/**
...
...
@@ -20,12 +20,10 @@ public:
* @param argc The number of command line arguments.
* @param argv The array of command line arguments.
*/
CLConfigurator
(
int
argc
,
char
**
argv
);
CLConfigurator
(
int
argc
,
char
**
argv
);
int
readConfigFromSource
()
override
;
int
readConfigFromSource
(
std
::
string
target
)
override
;
int
pushConfigToSource
()
override
;
...
...
@@ -34,7 +32,8 @@ public:
int
insert
(
std
::
map
<
std
::
string
,
std
::
string
>
,
std
::
string
target
)
override
;
~
CLConfigurator
()
{
}
~
CLConfigurator
()
{
}
};
}
This diff is collapsed.
Click to expand it.
src/CL_Conf.cpp
+
7
−
6
View file @
588230ea
...
...
@@ -17,27 +17,28 @@ int CLConfigurator::pushConfigToSource() {
}
int
CLConfigurator
::
readConfigFromSource
(
std
::
string
target
)
{
for
(
int
i
=
1
;
i
<
argc
-
1
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
-
1
;
++
i
)
{
std
::
string
arg
=
argv
[
i
];
boost
::
to_lower
(
arg
);
size_t
posTarget
=
arg
.
find
(
"--"
+
target
);
size_t
posTarget
=
arg
.
find
(
"--"
+
target
);
size_t
posSeparator
=
arg
.
find
(
'_'
);
if
(
posTarget
==
0
&&
posSeparator
==
std
::
string
(
"--"
+
target
).
size
())
{
if
(
posTarget
==
0
&&
posSeparator
==
std
::
string
(
"--"
+
target
).
size
())
{
std
::
string
key
=
arg
.
substr
(
2
);
this
->
config
[
key
]
=
argv
[
i
+
1
];
this
->
config
[
key
]
=
argv
[
i
+
1
];
}
}
return
1
;
}
int
CLConfigurator
::
readConfigFromSource
()
{
for
(
int
i
=
1
;
i
<
argc
-
1
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
-
1
;
++
i
)
{
std
::
string
arg
=
argv
[
i
];
size_t
posDash
=
arg
.
find
(
"--"
);
size_t
posSeparator
=
arg
.
find
(
'_'
);
if
(
posDash
==
0
&&
posSeparator
!=
std
::
string
::
npos
)
{
std
::
string
key
=
arg
.
substr
(
2
);
this
->
config
[
key
]
=
argv
[
i
+
1
];
this
->
config
[
key
]
=
argv
[
i
+
1
];
}
}
return
1
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment