Boost.UI
User Interface Boost library
|
Go to the documentation of this file.
8 #ifndef BOOST_UI_STRINGS_BOX_HPP
9 #define BOOST_UI_STRINGS_BOX_HPP
13 #ifdef BOOST_HAS_PRAGMA_ONCE
20 #include <boost/range/begin.hpp>
21 #include <boost/range/end.hpp>
22 #include <boost/range/size.hpp>
34 template <
class Iterator>
35 std::vector<uistring> begin_end_to_vector_uistring(Iterator first, Iterator last)
37 std::vector<uistring> result;
38 result.reserve(last - first);
39 std::copy(first, last, std::back_inserter(result));
43 template <
class Range>
44 std::vector<uistring> range_to_vector_uistring(
const Range& r)
46 std::vector<uistring> result;
48 std::copy(boost::begin(r), boost::end(r), std::back_inserter(result));
52 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
55 initializer_list_to_vector_uistring(std::initializer_list<T> list)
57 std::vector<uistring> result;
58 result.reserve(list.size());
59 std::copy(list.begin(), list.end(), std::back_inserter(result));
94 size_type
size()
const;
101 { clear();
return append(options); }
104 {
return assign(std::vector<uistring>(count, value)); }
106 template <
class Iterator>
108 {
return assign(detail::begin_end_to_vector_uistring(first, last)); }
110 template <
class Range>
112 {
return assign(detail::range_to_vector_uistring(r)); }
114 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
117 {
return assign(detail::initializer_list_to_vector_uistring(list)); }
122 strings_box& append(
const std::vector<uistring>& options);
125 {
return append(std::vector<uistring>(count, value)); }
127 template <
class Iterator>
129 {
return append(detail::begin_end_to_vector_uistring(first, last)); }
131 template <
class Range>
133 {
return append(detail::range_to_vector_uistring(r)); }
135 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
138 {
return append(detail::initializer_list_to_vector_uistring(list)); }
143 void push_back(
const uistring& value);
149 void check_range(size_type pos)
const;
152 native_impl* get_native();
153 const native_impl* get_native()
const;
159 #endif // BOOST_UI_STRINGS_BOX_HPP
Helper class to convert string between UI and application logic only.
Definition: string.hpp:49
strings_box & append(Iterator first, Iterator last)
Appends contents to the end.
Definition: strings_box.hpp:128
Boost C++ libraries namespace.
Definition: window.hpp:19
basic_size< coord_type > size
2D size coordinates
Definition: coord.hpp:416
strings_box & assign(size_type count, const value_type &value)
Replaces the contents of the container.
Definition: strings_box.hpp:103
bool empty() const
Checks whether the container has options.
Definition: strings_box.hpp:91
index_type size_type
Integral type.
Definition: strings_box.hpp:78
strings_box & assign(std::initializer_list< T > list)
Replaces the contents of the container.
Definition: strings_box.hpp:116
strings_box & assign(Iterator first, Iterator last)
Replaces the contents of the container.
Definition: strings_box.hpp:107
strings_box & append(std::initializer_list< T > list)
Appends contents to the end.
Definition: strings_box.hpp:137
uistring value_type
String type.
Definition: strings_box.hpp:75
strings_box & append(const Range &r)
Appends contents to the end.
Definition: strings_box.hpp:132
strings_box & assign(const std::vector< uistring > &options)
Replaces the contents of the container.
Definition: strings_box.hpp:100
strings_box & assign(const Range &r)
Replaces the contents of the container.
Definition: strings_box.hpp:111
Abstract widget that holds array of strings.
Definition: strings_box.hpp:71
strings_box & append(size_type count, const value_type &value)
Appends contents to the end.
Definition: strings_box.hpp:124