| Qore ConnectionProvider Module Reference 2.0.1

Loading...
Searching...
No Matches
OptionHelper.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
2// Qore OptionHelper class definition
3
4/* OptionHelper.qc Copyright 2016 - 2024 Qore Technologies, s.r.o.
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23*/
24
26
28 namespace ConnectionProvider {
30 class OptionHelper : public Qore::Serializable {
31
32 public:
34 static *string getString(*hash<auto> opts, string key, *bool required, *string default_value);
35
37 static *bool getBool(*hash<auto> opts, string key, *bool required, *bool default_value);
38
40 static *int getInt(*hash<auto> opts, string key, *bool required, *int default_value);
41
43 static *hash<auto> getHash(*hash<auto> opts, string key, *bool required, *hash<auto> default_value);
44
46 static auto getOptionType(*hash<auto> opts, string key, int type_code, string type_name, *bool required, auto default_value);
47};
48};
ConnectionProvider::OptionHelper
Class with helper methods to options in a hash.
Definition OptionHelper.qc.dox.h:30
ConnectionProvider::OptionHelper::getString
static *string getString(*hash< auto > opts, string key, *bool required, *string default_value)
Returns a string value from a hash.
ConnectionProvider::OptionHelper::getBool
static *bool getBool(*hash< auto > opts, string key, *bool required, *bool default_value)
Returns a boolean value from a hash.
ConnectionProvider::OptionHelper::getInt
static *int getInt(*hash< auto > opts, string key, *bool required, *int default_value)
Gets an integer option.
ConnectionProvider::OptionHelper::getHash
static *hash< auto > getHash(*hash< auto > opts, string key, *bool required, *hash< auto > default_value)
Returns a hash value from a hash.
ConnectionProvider::OptionHelper::getOptionType
static auto getOptionType(*hash< auto > opts, string key, int type_code, string type_name, *bool required, auto default_value)
gets an option value of the given type
Qore::Serializable
ConnectionProvider
The ConnectionProvider namespace.
Definition AbstractConnection.qc.dox.h:28