Loading...
Searching...
No Matches
OptionHelper.qc.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
// Qore OptionHelper class definition
/* OptionHelper.qc Copyright 2016 - 2024 Qore Technologies, s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
namespace ConnectionProvider {
class OptionHelper : public Qore::Serializable {
public:
static *string getString(*hash<auto> opts, string key, *bool required, *string default_value);
static *bool getBool(*hash<auto> opts, string key, *bool required, *bool default_value);
static *int getInt(*hash<auto> opts, string key, *bool required, *int default_value);
static *hash<auto> getHash(*hash<auto> opts, string key, *bool required, *hash<auto> default_value);
static auto getOptionType(*hash<auto> opts, string key, int type_code, string type_name, *bool required, auto default_value);
};
};
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
ConnectionProvider
The ConnectionProvider namespace.
Definition AbstractConnection.qc.dox.h:28