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)());
MethodItemPtrViewStringValue(C *collection, T(I::*method)() const)
Construct for the given collection with the given data retrieval method.
Definition: stringviewvalue.h:141
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
virtual std::string value(unsigned int index) const
Return value for given index.
Definition: stringviewvalue.h:82
Base class to provide a value of a given type for an item view.
Definition: viewvalue.h:40
Convenience template to return a member of the class in a collection of pointers as the value for a v...
Definition: stringviewvalue.h:131
IndexItemViewStringValue(const C &collection)
Construct with collection to index.
Definition: stringviewvalue.h:77
Base class to provide a value as a string.
Definition: stringviewvalue.h:50
Convenience template to return an item of a collection as the value for a view as a string.
Definition: stringviewvalue.h:69
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
std::string to_string(const T &value)
Convert a value to a string.
Definition: stringutils.h:44
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 as the value for a view.
Definition: stringviewvalue.h:97
MethodItemViewStringValue(C *collection, T(I::*method)() const)
Construct for the given collection with the given data retrieval method.
Definition: stringviewvalue.h:107
virtual std::string value(unsigned int index) const =0
Provide the value for the view.