<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Troy, Peter,</p>
<p>Thank you! My usecase is to list the options available for one
particular (bible translation) module.</p>
<p>@Troy: The solution you suggested is probably what I need. Or are
there better solutions based on my usecase mentioned above?<br>
<br>
Best regards,<br>
Tobias</p>
<div class="moz-cite-prefix">On 05.05.19 15:41, Troy A. Griffitts
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:0A09B64E-5C4F-48B6-A24B-A2069EBDE218@crosswire.org">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
While Peter is correct about how to find all the options that any
loaded module might allow for toggling by an end user... and if
this is your purpose, you should certainly use the methods Peter
suggested... your question as to more generally how to read config
entries which have the same key values is answered by how to
iterate a multimap in C++. SWModule::getConfig returns the full
multimap of config entries. Something like this should work:Hi <br>
<br>
ConfigEntMap::const_iterator begin =
module->getConfig().lower_bound("Key");<br>
ConfigEntMap::const_iterator end =
module->getConfig().upper_bound("Key");<br>
<br>
for(; begin !=end; ++begin) {<br>
cout << begin->first.c_str() << " = " <<
begin->second.c_str() << endl;<br>
}<br>
<br>
But I've never needed to do this as a client of the library. Maybe
if you tell us your use case, we can recommend a facility in the
system which might make things easier for you.<br>
<br>
Troy<br>
<br>
<div class="gmail_quote">On May 5, 2019 2:04:11 AM MST, Peter von
Kaehne <a class="moz-txt-link-rfc2396E" href="mailto:refdoc@gmx.net"><refdoc@gmx.net></a> wrote:
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<pre class="k9mail">On Sun, 2019-05-05 at 08:49 +0200, Tobias Klein wrote:
<blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Hi,
how is SWModule::getConfigEntry(const char *key) supposed to behave
when there are multiple entries with the same key?
</blockquote>
There is a set of separate methods for those.
Check out ./examples/cmdline/listoptions.cpp
<blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> {
SWMgr library;
StringList options = library.getGlobalOptions();
for (StringList::const_iterator it = options.begin(); it !=
options.end(); ++it) {
cout << *it << " (" <<
library.getGlobalOptionTip(*it) << ")\n";
StringList optionValues =
library.getGlobalOptionValues(*it);
for (StringList::const_iterator it2 =
optionValues.begin(); it2 != optionValues.end(); ++it2) {
cout << "\t" << *it2 << "\n";
}
}
</blockquote><hr>sword-devel mailing list: <a class="moz-txt-link-abbreviated" href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a>
<a href="http://www.crosswire.org/mailman/listinfo/sword-devel" moz-do-not-send="true">http://www.crosswire.org/mailman/listinfo/sword-devel</a>
Instructions to unsubscribe/change your settings at above page
</pre>
</blockquote>
</div>
<br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my
brevity.
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
sword-devel mailing list: <a class="moz-txt-link-abbreviated" href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a>
<a class="moz-txt-link-freetext" href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a>
Instructions to unsubscribe/change your settings at above page</pre>
</blockquote>
</body>
</html>