AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::Impl::ChatCommands::ChatCommandResult Struct Reference

#include "ChatCommandHelpers.h"

Public Member Functions

 ChatCommandResult (std::nullopt_t)
 
 ChatCommandResult (std::string const &)=delete
 
 ChatCommandResult (std::string &&s)
 
 ChatCommandResult (char const *c)
 
 ChatCommandResult (std::string_view s)
 
 ChatCommandResult (ChatCommandResult const &)=delete
 
 ChatCommandResult (ChatCommandResult &&)=default
 
ChatCommandResultoperator= (ChatCommandResult const &)=delete
 
ChatCommandResultoperator= (ChatCommandResult &&)=default
 
std::string_view operator* () const
 
bool IsSuccessful () const
 
 operator bool () const
 
bool HasErrorMessage () const
 
std::string const & GetErrorMessage () const
 

Private Attributes

std::variant< std::monostate, std::string_view, std::string > _storage
 

Detailed Description

Constructor & Destructor Documentation

◆ ChatCommandResult() [1/7]

Acore::Impl::ChatCommands::ChatCommandResult::ChatCommandResult ( std::nullopt_t  )
inline
102: _storage() {}
std::variant< std::monostate, std::string_view, std::string > _storage
Definition: ChatCommandHelpers.h:120

◆ ChatCommandResult() [2/7]

Acore::Impl::ChatCommands::ChatCommandResult::ChatCommandResult ( std::string const &  )
delete

◆ ChatCommandResult() [3/7]

Acore::Impl::ChatCommands::ChatCommandResult::ChatCommandResult ( std::string &&  s)
inline
104: _storage(std::in_place_type<std::string>, std::forward<std::string>(s)) {}

◆ ChatCommandResult() [4/7]

Acore::Impl::ChatCommands::ChatCommandResult::ChatCommandResult ( char const *  c)
inline
105: _storage(std::in_place_type<std::string>, c) {}

◆ ChatCommandResult() [5/7]

Acore::Impl::ChatCommands::ChatCommandResult::ChatCommandResult ( std::string_view  s)
inline
106: _storage(std::in_place_type<std::string_view>, s) {}

◆ ChatCommandResult() [6/7]

Acore::Impl::ChatCommands::ChatCommandResult::ChatCommandResult ( ChatCommandResult const &  )
delete

◆ ChatCommandResult() [7/7]

Acore::Impl::ChatCommands::ChatCommandResult::ChatCommandResult ( ChatCommandResult &&  )
default

Member Function Documentation

◆ GetErrorMessage()

◆ HasErrorMessage()

◆ IsSuccessful()

bool Acore::Impl::ChatCommands::ChatCommandResult::IsSuccessful ( ) const
inline
114{ return std::holds_alternative<std::string_view>(_storage); }

References _storage.

Referenced by operator bool().

◆ operator bool()

Acore::Impl::ChatCommands::ChatCommandResult::operator bool ( ) const
inlineexplicit
115{ return IsSuccessful(); }
bool IsSuccessful() const
Definition: ChatCommandHelpers.h:114

References IsSuccessful().

◆ operator*()

std::string_view Acore::Impl::ChatCommands::ChatCommandResult::operator* ( ) const
inline
113{ return std::get<std::string_view>(_storage); }

References _storage.

◆ operator=() [1/2]

ChatCommandResult & Acore::Impl::ChatCommands::ChatCommandResult::operator= ( ChatCommandResult &&  )
default

◆ operator=() [2/2]

ChatCommandResult & Acore::Impl::ChatCommands::ChatCommandResult::operator= ( ChatCommandResult const &  )
delete

Member Data Documentation

◆ _storage

std::variant<std::monostate, std::string_view, std::string> Acore::Impl::ChatCommands::ChatCommandResult::_storage
private