37template<
typename CharT>
42 using std::vector<CharT>::vector;
104 auto buffer_iter = buffer.begin();
105 auto buffer_end = buffer.end();
106 auto data_iter = data.begin();
107 auto data_end = data.end();
109 for(;buffer_iter!=buffer_end && data_iter != data_end; ++buffer_iter,++data_iter)
110 *buffer_iter = *data_iter;
124 return DataType(buffer.begin(), buffer.end());
137 const auto padding = memory_type.
padding();
138 auto end_it = buffer.end();
142 end_it = std::find(buffer.begin(), buffer.end(),
'\0');
146 end_it = std::find_if_not(buffer.rbegin(), buffer.rend(), [](
const BufferType::value_type &c)
147 { return c ==
'\0'; })
152 end_it = std::find_if_not(buffer.rbegin(), buffer.rend(), [](
const BufferType::value_type &c)
153 { return c ==
' '; })
157#pragma clang diagnostic push
158#pragma clang diagnostic ignored "-Wcovered-switch-default"
163#pragma clang diagnostic pop
166 return DataType(buffer.begin(), end_it);
182 auto iter = buffer.begin();
183 for(
const auto &str: data)
185 std::copy(str.begin(),str.end(),iter);
186 std::advance(iter,unsigned2signed<ssize_t>(memory_type.
size()));
198 auto start=buffer.begin();
199 while(start!=buffer.end())
201 auto end = start+unsigned2signed<std::string::difference_type>(memory_type.
size());
202 data.push_back(std::string(start,end));
Definition fixed_length_string.hpp:39
static FixedLengthStringBuffer< CharT > create(const datatype::String &datatype, const dataspace::Dataspace &dataspace)
Definition fixed_length_string.hpp:44
dataspace base class
Definition dataspace.hpp:41
SelectionManager selection
access to selection manager
Definition dataspace.hpp:144
virtual hssize_t size() const
number of elements in the dataspace
size_t size() const
return the number of elements in the current selection
SelectionType type() const
get the type of the current selection
string datatype
Definition string.hpp:40
StringPad padding() const
get the current string padding
size_t size() const override
get current size of the string type
@ NullTerm
indicates a null terminated string type
@ NullPad
indicates a null padded string type
@ SpacePad
indicates a space padded string type
top-level namespace of the entire library
Definition attribute.hpp:45
static DataType from_buffer_trimmed(const BufferType &buffer, const datatype::String &memory_type, const dataspace::Dataspace &)
store data from buffer in target memory and trim any tailing null-terminating characters
Definition fixed_length_string.hpp:133
std::string DataType
Definition fixed_length_string.hpp:85
static DataType from_buffer(const BufferType &buffer, const datatype::String &, const dataspace::Dataspace &)
store data from buffer in target memory
Definition fixed_length_string.hpp:120
static BufferType to_buffer(const DataType &data, const datatype::String &memory_type, const dataspace::Dataspace &memory_space)
create fixed length string buffer from data
Definition fixed_length_string.hpp:98
std::vector< std::string > DataType
Definition fixed_length_string.hpp:173
static DataType from_buffer(const BufferType &buffer, const datatype::String &memory_type, const dataspace::Dataspace &)
Definition fixed_length_string.hpp:192
static BufferType to_buffer(const DataType &data, const datatype::String &memory_type, const dataspace::Dataspace &memory_space)
Definition fixed_length_string.hpp:176
Definition fixed_length_string.hpp:59
FixedLengthStringBuffer< char > BufferType
Definition fixed_length_string.hpp:61
static BufferType create_buffer(const datatype::String &datatype, const dataspace::Dataspace &dataspace)
Definition fixed_length_string.hpp:63
static DataType from_buffer(const BufferType &, const datatype::String &, const dataspace::Dataspace &)
Definition fixed_length_string.hpp:75
T DataType
Definition fixed_length_string.hpp:60
static BufferType to_buffer(const DataType &, const datatype::String &, const dataspace::Dataspace &)
Definition fixed_length_string.hpp:69