Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jean-Francois Dockes
recoll
Commits
148e7eec
Commit
148e7eec
authored
Feb 02, 2017
by
Jean-Francois Dockes
Browse files
add getConfParam->std::set
parent
90bae886
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/common/rclconfig.cpp
View file @
148e7eec
...
...
@@ -395,7 +395,7 @@ bool RclConfig::getConfParam(const string &name, bool *bvp, bool shallow) const
}
bool
RclConfig
::
getConfParam
(
const
string
&
name
,
vector
<
string
>
*
svvp
,
bool
shallow
)
const
bool
shallow
)
const
{
if
(
!
svvp
)
return
false
;
...
...
@@ -406,8 +406,20 @@ bool RclConfig::getConfParam(const string &name, vector<string> *svvp,
return
stringToStrings
(
s
,
*
svvp
);
}
bool
RclConfig
::
getConfParam
(
const
string
&
name
,
unordered_set
<
string
>
*
out
,
bool
shallow
)
const
{
vector
<
string
>
v
;
if
(
!
out
||
!
getConfParam
(
name
,
&
v
,
shallow
))
{
return
false
;
}
out
->
clear
();
out
->
insert
(
v
.
begin
(),
v
.
end
());
return
true
;
}
bool
RclConfig
::
getConfParam
(
const
string
&
name
,
vector
<
int
>
*
vip
,
bool
shallow
)
const
bool
shallow
)
const
{
if
(
!
vip
)
return
false
;
...
...
@@ -420,7 +432,8 @@ bool RclConfig::getConfParam(const string &name, vector<int> *vip,
char
*
ep
;
vip
->
push_back
(
strtol
(
vs
[
i
].
c_str
(),
&
ep
,
0
));
if
(
ep
==
vs
[
i
].
c_str
())
{
LOGDEB
(
"RclConfig::getConfParam: bad int value in ["
<<
(
name
)
<<
"]
\n
"
);
LOGDEB
(
"RclConfig::getConfParam: bad int value in ["
<<
name
<<
"]
\n
"
);
return
false
;
}
}
...
...
src/common/rclconfig.h
View file @
148e7eec
...
...
@@ -140,6 +140,10 @@ class RclConfig {
* (stringToStrings). Can fail if the string is malformed. */
bool
getConfParam
(
const
string
&
name
,
vector
<
string
>
*
value
,
bool
shallow
=
false
)
const
;
/** Variant with conversion to unordered_set<string>
* (stringToStrings). Can fail if the string is malformed. */
bool
getConfParam
(
const
string
&
name
,
std
::
unordered_set
<
std
::
string
>
*
v
,
bool
shallow
=
false
)
const
;
/** Variant with conversion to vector<int> */
bool
getConfParam
(
const
string
&
name
,
vector
<
int
>
*
value
,
bool
shallow
=
false
)
const
;
...
...
@@ -189,8 +193,7 @@ class RclConfig {
string
getIdxStatusFile
()
const
;
/** Do path translation according to the ptrans table */
void
urlrewrite
(
const
string
&
dbdir
,
string
&
url
)
const
;
ConfSimple
*
getPTrans
()
{
ConfSimple
*
getPTrans
()
{
return
m_ptrans
;
}
/** Get Web Queue directory name */
...
...
Write
Preview
Supports
Markdown
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