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

Wii U SmbDriver built on libsmb2, registering its own smb:/ newlib devoptab. More...

#include <WutSmbDriver.h>

Inheritance diagram for WutSmbDriver:
[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
 Brings the Wii U network connection up if it isn't already, via nn::ac (ACConnect()).
 

Static Public Member Functions

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

Detailed Description

Wii U SmbDriver built on libsmb2, registering its own smb:/ newlib devoptab.

Definition at line 17 of file WutSmbDriver.h.

Member Function Documentation

◆ connect()

SmbConnectResult WutSmbDriver::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 370 of file WutSmbDriver.cpp.

◆ connectResultMessage()

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

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

Never returns nullptr.

Implements SmbDriver.

Definition at line 440 of file WutSmbDriver.cpp.

◆ disconnect()

void WutSmbDriver::disconnect ( )
overridevirtual

Unmounts and drops the connection.

Safe to call whether or not currently connected.

Implements SmbDriver.

Definition at line 422 of file WutSmbDriver.cpp.

◆ ensureNetworkUp()

bool WutSmbDriver::ensureNetworkUp ( )
overridevirtual

Brings the Wii U network connection up if it isn't already, via nn::ac (ACConnect()).

Blocking. Returns false (with getLastError() set) if AC wasn't initialized or the connect attempt failed.

Implements SmbDriver.

Definition at line 343 of file WutSmbDriver.cpp.

◆ getContext()

static smb2_context * WutSmbDriver::getContext ( )
inlinestatic

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

Only one WutSmbDriver/mount exists at a time.

Definition at line 33 of file WutSmbDriver.h.

◆ getLastError()

const char * WutSmbDriver::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 452 of file WutSmbDriver.cpp.

◆ getMountPath()

const char * WutSmbDriver::getMountPath ( ) const
inlineoverridevirtual

devoptab-style mount path (eg.

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

Implements SmbDriver.

Definition at line 27 of file WutSmbDriver.h.

◆ init()

void WutSmbDriver::init ( )
overridevirtual

One-time setup.

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

Implements SmbDriver.

Definition at line 307 of file WutSmbDriver.cpp.

◆ isConnected()

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

Implements SmbDriver.

Definition at line 25 of file WutSmbDriver.h.

◆ isNetworkUp()

bool WutSmbDriver::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 333 of file WutSmbDriver.cpp.

◆ shutdown()

void WutSmbDriver::shutdown ( )
overridevirtual

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

Implements SmbDriver.

Definition at line 315 of file WutSmbDriver.cpp.


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