25#ifndef FBCPP_SERVICE_MANAGER_H
26#define FBCPP_SERVICE_MANAGER_H
75 return serviceManagerName;
83 serviceManagerName = value;
124 const std::optional<std::string>&
getRole()
const
141 const std::vector<std::uint8_t>&
getSpb()
const
160 spb = std::move(value);
165 std::optional<std::string> server;
166 std::string serviceManagerName =
"service_mgr";
167 std::optional<std::string> userName;
168 std::optional<std::string> password;
169 std::optional<std::string> role;
170 std::vector<std::uint8_t> spb;
195 handle{std::move(o.handle)}
222 handle = std::move(o.handle);
255 return handle !=
nullptr;
280 static void addSpbInt(fb::IXpbBuilder* builder, impl::StatusWrapper* status,
unsigned char tag,
281 std::uint64_t value,
const char* what)
283 if (value >
static_cast<std::uint64_t
>(std::numeric_limits<std::int64_t>::max()))
286 if (value >
static_cast<std::uint64_t
>(std::numeric_limits<int>::max()))
287 builder->insertBigInt(status, tag,
static_cast<std::int64_t
>(value));
289 builder->insertInt(status, tag,
static_cast<int>(value));
292 void startAction(
const std::vector<std::uint8_t>& spb);
293 void waitForCompletion(
const VerboseOutput& verboseOutput = {},
bool requestStdin =
false);
300 FbRef<fb::IService> handle;
Represents a Firebird client library instance.
Base exception class for all fb-cpp exceptions.
Reference-counted smart pointer for Firebird objects using addRef/release semantics.
Represents options used when creating a ServiceManager object.
ServiceManagerOptions & setServiceManagerName(const std::string &value)
Sets the service manager name.
ServiceManagerOptions & setUserName(const std::string &value)
Sets the user name used to attach to the service manager.
const std::vector< std::uint8_t > & getSpb() const
Returns the raw service attach SPB.
ServiceManagerOptions & setSpb(const std::vector< std::uint8_t > &value)
Sets the raw service attach SPB.
const std::optional< std::string > & getServer() const
Returns the server used to attach to the service manager.
const std::string & getServiceManagerName() const
Returns the service manager name.
ServiceManagerOptions & setSpb(std::vector< std::uint8_t > &&value)
Sets the raw service attach SPB.
ServiceManagerOptions & setRole(const std::string &value)
Sets the role used to attach to the service manager.
const std::optional< std::string > & getPassword() const
Returns the password used to attach to the service manager.
const std::optional< std::string > & getUserName() const
Returns the user name used to attach to the service manager.
const std::optional< std::string > & getRole() const
Returns the role used to attach to the service manager.
ServiceManagerOptions & setPassword(const std::string &value)
Sets the password used to attach to the service manager.
ServiceManagerOptions & setServer(const std::string &value)
Sets the server used to attach to the service manager.
Represents a connection to the Firebird service manager.
Client & getClient() noexcept
Returns the Client object reference used to create this ServiceManager object.
ServiceManager & operator=(ServiceManager &&o) noexcept
Transfers ownership of another ServiceManager into this one.
ServiceManager(ServiceManager &&o) noexcept
Move constructor.
void disconnect()
Detaches from the service manager.
bool isValid() noexcept
Returns whether the ServiceManager object is valid.
std::function< void(std::string_view line)> VerboseOutput
Function invoked when a verbose service output line is available.
~ServiceManager() noexcept
Detaches from the service manager.
FbRef< fb::IService > getHandle() noexcept
Returns the internal Firebird IService handle.