libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
SmbDriver.h
1/****************************************************************************
2 * Platform Abstraction Layer
3 * Daryl Borth 2026
4 * SmbDriver.h
5 *
6 * Network-share driver. Exactly one instance is owned by each platform's
7 * FileSystemDriver and returned from FileSystemDriver::getSmb().
8 *
9 * On a successful connect(), a devoptab-style mount path is available via
10 * getMountPath() and the rest of the app reads through it with ordinary
11 * POSIX calls.
12 ***************************************************************************/
13#pragma once
14
20{
21 char host[64];
22 char share[64];
23 char user[32];
24 char password[32];
25};
26
39
43{
44 public:
45 virtual ~SmbDriver() = default;
46
49 virtual void init() = 0;
51 virtual void shutdown() = 0;
52
55 virtual bool isNetworkUp() const = 0;
56
59 virtual bool ensureNetworkUp() = 0;
60
64 virtual SmbConnectResult connect(const SmbShareInfo & info) = 0;
65
68 virtual void disconnect() = 0;
69
71 virtual bool isConnected() const = 0;
72
75 virtual const char * getMountPath() const = 0;
76
79 virtual const char * connectResultMessage(SmbConnectResult result) const = 0;
80
83 virtual const char * getLastError() const { return ""; }
84};
Network-share driver.
Definition SmbDriver.h:43
virtual const char * getLastError() const
Raw, implementation-specific detail behind the last failure.
Definition SmbDriver.h:83
virtual SmbConnectResult connect(const SmbShareInfo &info)=0
Attempts to connect and mount in one call.
virtual bool isConnected() const =0
virtual const char * connectResultMessage(SmbConnectResult result) const =0
Short, user-displayable reason for a non-Success SmbConnectResult.
virtual void shutdown()=0
Disconnects if connected and releases whatever init() set up.
virtual bool isNetworkUp() const =0
True if the network is already up, i.e.
virtual bool ensureNetworkUp()=0
Brings the network up if it isn't already.
virtual const char * getMountPath() const =0
devoptab-style mount path (eg.
virtual void disconnect()=0
Unmounts and drops the connection.
virtual void init()=0
One-time setup.
SmbConnectResult
Result of a single connect() attempt.
Definition SmbDriver.h:33
@ ConnectFailed
network's up but the server/share/credentials didn't work
Definition SmbDriver.h:37
@ InvalidSettings
host or share is empty - nothing to try
Definition SmbDriver.h:35
@ NetworkUnavailable
no usable network connection at all
Definition SmbDriver.h:36
Credentials/target for a single SMB share.
Definition SmbDriver.h:20
char share[64]
share name, eg.
Definition SmbDriver.h:22
char password[32]
"" for guest/anonymous
Definition SmbDriver.h:24
char user[32]
"" for guest/anonymous
Definition SmbDriver.h:23
char host[64]
server IP or hostname
Definition SmbDriver.h:21