31 #ifndef TBX_STRINGVIEWVALUE_H_ 32 #define TBX_STRINGVIEWVALUE_H_ 34 #include "viewvalue.h" 35 #include "../stringutils.h" 57 virtual std::string
value(
unsigned int index)
const = 0;
82 virtual std::string
value(
unsigned int index)
const 100 T (I::*_method)()
const;
108 _collection(collection), _method(method) {}
114 virtual std::string
value(
unsigned int index)
const 116 return to_string((((*_collection)[index]).*_method)());
134 T (I::*_method)()
const;
142 _collection(collection), _method(method) {}
148 virtual std::string
value(
unsigned int index)
const 150 return to_string((((*_collection)[index])->*_method)());
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:34
Helper classes to display and edit data.
MethodItemViewStringValue(C *collection, T(I::*method)() const)
Construct for the given collection with the given data retrieval method.
Definition: stringviewvalue.h:107
Base class to provide a value of a given type for an item view.
Definition: viewvalue.h:39
virtual std::string value(unsigned int index) const =0
Provide the value for the view.
Convenience template to return an item of a collection as the value for a view as a string...
Definition: stringviewvalue.h:68
MethodItemPtrViewStringValue(C *collection, T(I::*method)() const)
Construct for the given collection with the given data retrieval method.
Definition: stringviewvalue.h:141
std::string to_string(const T &value)
Convert a value to a string.
Definition: stringutils.h:44
Base class to provide a value as a string.
Definition: stringviewvalue.h:49
IndexItemViewStringValue(const C &collection)
Construct with collection to index.
Definition: stringviewvalue.h:77
virtual std::string value(unsigned int index) const
Get the value for the index by calling the method from the constructor on the object.
Definition: stringviewvalue.h:148
Convenience template to return a member of the class in a collection of pointers as the value for a v...
Definition: stringviewvalue.h:130
Convenience template to return a member of the class in a collection as the value for a view...
Definition: stringviewvalue.h:96
virtual std::string value(unsigned int index) const
Return value for given index.
Definition: stringviewvalue.h:82
virtual std::string value(unsigned int index) const
Get the value for the index by calling the method from the constructor on the object.
Definition: stringviewvalue.h:114