libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
OgcSmbDriver Class Reference

Wraps libsmb2 behind a "smb:/" devoptab. More...

#include <OgcSmbDriver.h>

Inheritance diagram for OgcSmbDriver:
[legend]

Public Member Functions

void init () override
 One-time setup.
 
void shutdown () override
 Disconnects if connected and releases whatever init() set up.
 
SmbConnectResult connect (const SmbShareInfo &info) override
 Attempts to connect and mount in one call.
 
void disconnect () override
 Unmounts and drops the connection.
 
bool isConnected () const override
 
const char * getMountPath () const override
 devoptab-style mount path (eg.
 
const char * connectResultMessage (SmbConnectResult result) const override
 Short, user-displayable reason for a non-Success SmbConnectResult.
 
const char * getLastError () const override
 Raw, implementation-specific detail behind the last failure.
 
bool isNetworkUp () const override
 True if the network is already up, i.e.
 
bool ensureNetworkUp () override
 Ensures the network is up via the platform's network helper (WiiNetwork or GameCubeNetwork).
 

Static Public Member Functions

static smb2_context * getContext ()
 The active context, used by the free-function devoptab callbacks in OgcSmbDriver.cpp.
 

Detailed Description

Wraps libsmb2 behind a "smb:/" devoptab.

Both GameCube (via BBA) and Wii bring the network up, then share the identical libsmb2 connect/devoptab

Definition at line 22 of file OgcSmbDriver.h.

Member Function Documentation

◆ connect()

SmbConnectResult OgcSmbDriver::connect ( const SmbShareInfo & info)
overridevirtual

Attempts to connect and mount in one call.

No-ops (returns Success) if already connected to the same host+share; reconnects if info describes a different target.

Implements SmbDriver.

Definition at line 347 of file OgcSmbDriver.cpp.

◆ connectResultMessage()

const char * OgcSmbDriver::connectResultMessage ( SmbConnectResult result) const
overridevirtual

Short, user-displayable reason for a non-Success SmbConnectResult.

Never returns nullptr.

Implements SmbDriver.

Definition at line 426 of file OgcSmbDriver.cpp.

◆ disconnect()

void OgcSmbDriver::disconnect ( )
overridevirtual

Unmounts and drops the connection.

Safe to call whether or not currently connected.

Implements SmbDriver.

Definition at line 408 of file OgcSmbDriver.cpp.

◆ ensureNetworkUp()

bool OgcSmbDriver::ensureNetworkUp ( )
overridevirtual

Ensures the network is up via the platform's network helper (WiiNetwork or GameCubeNetwork).

Blocking. Returns false (with getLastError() set) if it couldn't be brought up.

Implements SmbDriver.

Definition at line 336 of file OgcSmbDriver.cpp.

◆ getContext()

static smb2_context * OgcSmbDriver::getContext ( )
inlinestatic

The active context, used by the free-function devoptab callbacks in OgcSmbDriver.cpp.

Only one OgcSmbDriver/mount exists at a time.

Definition at line 38 of file OgcSmbDriver.h.

◆ getLastError()

const char * OgcSmbDriver::getLastError ( ) const
overridevirtual

Raw, implementation-specific detail behind the last failure.

Not something callers should rely on being non-empty.

Reimplemented from SmbDriver.

Definition at line 438 of file OgcSmbDriver.cpp.

◆ getMountPath()

const char * OgcSmbDriver::getMountPath ( ) const
inlineoverridevirtual

devoptab-style mount path (eg.

"smb:/"), or "" if not currently connected.

Implements SmbDriver.

Definition at line 32 of file OgcSmbDriver.h.

◆ init()

void OgcSmbDriver::init ( )
overridevirtual

One-time setup.

Does not connect - just prepares whatever the platform needs before a connect() can succeed.

Implements SmbDriver.

Definition at line 311 of file OgcSmbDriver.cpp.

◆ isConnected()

bool OgcSmbDriver::isConnected ( ) const
inlineoverridevirtual
Returns
true while a share is connected and mounted

Implements SmbDriver.

Definition at line 30 of file OgcSmbDriver.h.

◆ isNetworkUp()

bool OgcSmbDriver::isNetworkUp ( ) const
overridevirtual

True if the network is already up, i.e.

connect() won't first have to bring it up. Cheap and non-blocking - safe to poll.

Implements SmbDriver.

Definition at line 327 of file OgcSmbDriver.cpp.

◆ shutdown()

void OgcSmbDriver::shutdown ( )
overridevirtual

Disconnects if connected and releases whatever init() set up.

Implements SmbDriver.

Definition at line 316 of file OgcSmbDriver.cpp.


The documentation for this class was generated from the following files: