The Battle for Wesnoth  1.15.2+dev
Public Member Functions | Private Attributes | List of all members
wfl::variant_string Class Reference

#include <variant_value.hpp>

Inheritance diagram for wfl::variant_string:
Inheritance graph

Public Member Functions

 variant_string (const std::string &str)
 
virtual bool is_empty () const override
 Whether the stored value is considered empty or not. More...
 
virtual bool as_bool () const override
 Returns a bool expression of the variant value. More...
 
const std::string & get_string () const
 
virtual std::string string_cast () const override
 Returns the stored variant value in plain string form. More...
 
virtual std::string get_serialized_string () const override
 Returns the stored variant value in formula syntax. More...
 
virtual std::string get_debug_string (formula_seen_stack &, bool) const override
 Returns debug info for the variant value. More...
 
virtual bool equals (variant_value_base &other) const override
 Called to determine if this variant is equal to another of the same type. More...
 
virtual bool less_than (variant_value_base &other) const override
 Called to determine if this variant is less than another of the same type. More...
 
virtual const VARIANT_TYPE & get_type () const override
 Returns the id of the variant type. More...
 
- Public Member Functions inherited from wfl::variant_value_base
virtual std::size_t num_elements () const
 Returns the number of elements in a type. More...
 
virtual boost::iterator_range< variant_iteratormake_iterator () const
 Creates an iterator pair that can be used for iteration. More...
 
virtual variant deref_iterator (const boost::any &iter) const
 Implements the dereference functionality of variant_iterator for a value of this type. More...
 
virtual void iterator_inc (boost::any &) const
 Implements the increment functionality of variant_iterator for a value of this type. More...
 
virtual void iterator_dec (boost::any &) const
 Implements the decrement functionality of variant_iterator for a value of this type. More...
 
virtual bool iterator_equals (const boost::any &, const boost::any &) const
 Implements the equality functionality of variant_iterator for a value of this type. More...
 
virtual ~variant_value_base ()
 

Private Attributes

std::string string_
 

Detailed Description

Definition at line 370 of file variant_value.hpp.

Constructor & Destructor Documentation

◆ variant_string()

wfl::variant_string::variant_string ( const std::string &  str)
inlineexplicit

Definition at line 373 of file variant_value.hpp.

Member Function Documentation

◆ as_bool()

virtual bool wfl::variant_string::as_bool ( ) const
inlineoverridevirtual

Returns a bool expression of the variant value.

Reimplemented from wfl::variant_value_base.

Definition at line 380 of file variant_value.hpp.

◆ equals()

virtual bool wfl::variant_string::equals ( variant_value_base ) const
inlineoverridevirtual

Called to determine if this variant is equal to another of the same type.

This function is only called if get_type() returns the same result for both arguments.

Reimplemented from wfl::variant_value_base.

Definition at line 402 of file variant_value.hpp.

References wfl::value_ref_cast().

◆ get_debug_string()

virtual std::string wfl::variant_string::get_debug_string ( formula_seen_stack ,
bool   
) const
inlineoverridevirtual

Returns debug info for the variant value.

Reimplemented from wfl::variant_value_base.

Definition at line 397 of file variant_value.hpp.

◆ get_serialized_string()

std::string wfl::variant_string::get_serialized_string ( ) const
overridevirtual

Returns the stored variant value in formula syntax.

Reimplemented from wfl::variant_value_base.

Definition at line 187 of file variant_value.cpp.

References c.

◆ get_string()

const std::string& wfl::variant_string::get_string ( ) const
inline

Definition at line 385 of file variant_value.hpp.

◆ get_type()

virtual const VARIANT_TYPE& wfl::variant_string::get_type ( ) const
inlineoverridevirtual

Returns the id of the variant type.

Reimplemented from wfl::variant_value_base.

Definition at line 412 of file variant_value.hpp.

◆ is_empty()

virtual bool wfl::variant_string::is_empty ( ) const
inlineoverridevirtual

Whether the stored value is considered empty or not.

Reimplemented from wfl::variant_value_base.

Definition at line 375 of file variant_value.hpp.

◆ less_than()

virtual bool wfl::variant_string::less_than ( variant_value_base ) const
inlineoverridevirtual

Called to determine if this variant is less than another of the same type.

This function is only called if get_type() returns the same result for both arguments.

Reimplemented from wfl::variant_value_base.

Definition at line 407 of file variant_value.hpp.

◆ string_cast()

virtual std::string wfl::variant_string::string_cast ( ) const
inlineoverridevirtual

Returns the stored variant value in plain string form.

Reimplemented from wfl::variant_value_base.

Definition at line 390 of file variant_value.hpp.

Member Data Documentation

◆ string_

std::string wfl::variant_string::string_
private

Definition at line 419 of file variant_value.hpp.


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