The Vish Visualization Shell 0.3
Vish
Public Member Functions | List of all members
Wizt::VEnumSelection Class Reference

Container to hold a selection of strings with one of them selected. More...

#include <ocean/shrimp/VEnum.hpp>

Inheritance diagram for Wizt::VEnumSelection:
MemCore::StringList MemCore::ReferenceBase< StringList >

Public Member Functions

bool fromString (const string &)
 Assign entire enum range and selection from string.
 
const string & operator[] (unsigned i) const
 Return the i th entry's name.
 
bool select (const string &what)
 Select by string.
 
bool select (unsigned)
 Select by number.
 
const string & selected () const
 Return the current selection.
 
unsigned selectedNumber () const
 Return the currently selected entry as a number.
 
string toString () const
 Create an encoding of the entire enum range and selection.
 
 VEnumSelection ()
 Constructor.
 
 VEnumSelection (const MemCore::StringList &SL)
 Copy-like Constructor.
 
 VEnumSelection (const string &path, char delimiter)
 Construct by splitting a string.
 
 ~VEnumSelection ()
 Destructor.
 
- Public Member Functions inherited from MemCore::StringList
template<typename... Arguments>
void addString (const string &Value, Arguments... parameters)
 Recursive handling of parameter pack.
 
string collapse (const string &delimiter) const
 Collapse a list of strings to a single string.
 
bool contains (const string &s) const
 Check if a certain string is contained here.
 
 StringList ()
 Construct empty string list.
 
 StringList (const string &path, char delimiter)
 Construct from some string by splitting up using the giving delimiter.
 
 StringList (const string &s)
 Construct string list with one entry.
 
 StringList (const string &s0, const string &s1)
 Construct string list with two entries.
 
 StringList (const string &s0, const string &s1, const string &s2)
 Construct string list with three entries.
 
 StringList (const StringList &SL)
 Construct empty string list.
 
- Public Member Functions inherited from MemCore::ReferenceBase< StringList >
auto getObjectCountID () const noexcept
 Get a unique ID for this object in the given domain.
 
bool isIdentical (const WeakPtr< StringList, StringList > &PossibleSelf) const noexcept
 Check if this object is identical to the one used by the given pointer.
 
void mkAutoDestructive ()
 Marks this object as being automatically destructed, e.g.
 
refcount_t refcount () const noexcept
 The strong reference count.
 
 ReferenceBase (StringList *that) noexcept
 Constructor, initializes reference counter to zero.
 
const auto & self () const
 Return weak pointer to the object self.
 
refcount_t wrefcount () const noexcept
 The weak reference count.
 

Additional Inherited Members

- Public Types inherited from MemCore::ReferenceBase< StringList >
using reference_domain_t = StringList
 The type of the base class.
 
using SelfPtr_t = WeakPtr< StringList, StringList >
 Type for a pointer to this object itself.
 
- Protected Member Functions inherited from MemCore::ReferenceBase< StringList >
virtual void extremeUnction ()
 A virtual function that will be called just before the object is destroyed.
 
ReferenceBaseoperator= (const ReferenceBase &R)
 Protected assignment operator (should not be called).
 
void suicide ()
 Delete this.
 
virtual ~ReferenceBase ()
 Virtual destructor.
 

Detailed Description

Container to hold a selection of strings with one of them selected.

Member Function Documentation

◆ fromString()

bool Wizt::VEnumSelection::fromString ( const string &  s)

Assign entire enum range and selection from string.

The string is supposed to be of the form

X{X}{Y}{Z}
Definition OmegaPtrCheck.cpp:14
Definition elementary/memcore/test/shared_ptr/main.cpp:55

Where the first string outside of the {} is the selected value. @TODO Verify this function.

References select(), and MemCore::StringUtil::split().

◆ toString()

string Wizt::VEnumSelection::toString ( ) const

Create an encoding of the entire enum range and selection.

The resulting string will be all possible values of this enum enclosed in {} parenthesis, with the currently selected value leading, such as in:

X{X}{Y}{Z}

@TODO Verify this function.

References selected().