Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
TStrings.h
Go to the documentation of this file.
1#pragma once
2#include <misc/gen/TVector.h>
3
4namespace sf
5{
6
10template<typename T>
11class TStrings : public TVector<T>
12{
13 public:
21 typedef typename base_type::size_type size_type;
25 typedef typename base_type::value_type value_type;
37 TStrings() = default;
38
42 template<typename InputIterator>
43 TStrings(InputIterator first, InputIterator last);
44
48 explicit TStrings(std::initializer_list<value_type> list);
49
53 explicit TStrings(const base_type& list);
54
59 explicit TStrings(size_type sz);
60
66 explicit TStrings(const T& str, const T& separator = ",");
67
73 T join(const T& glue);
74
81 TStrings& explode(const T& str, const T& separator);
82
91 TStrings& split(const T& s, typename T::value_type sep, typename T::value_type delim_begin = 0, typename T::value_type delim_end = 0);
92};
93
102
103}// namespace sf
104
105// Include all inlined functions and template implementations.
106#include <misc/gen/TStrings.hpp>
Definition TVector.h:9
Counted vector of strings.
Definition TStrings.h:12
TIterator< value_type > iter_type
Iteration type of the template.
Definition TStrings.h:29
TStrings & split(const T &s, typename T::value_type sep, typename T::value_type delim_begin=0, typename T::value_type delim_end=0)
Appends all split entries. Splits' the passed string using a separator and text delimiter.
TStrings(const T &str, const T &separator=",")
Exploding constructor.
TStrings(InputIterator first, InputIterator last)
Initializing constructor using an iterator.
TVector< T > base_type
Base type of this template .
Definition TStrings.h:17
const iter_type const_iter_type
Iteration const type of the template.
Definition TStrings.h:33
TStrings(const base_type &list)
Initializer list constructor.
TStrings()=default
Default constructor.
TStrings(size_type sz)
Initializing constructor.
TStrings(std::initializer_list< value_type > list)
Initializer list constructor.
TStrings & explode(const T &str, const T &separator)
Splits all entries using the passed separator.
base_type::value_type value_type
Value type contained by this vector template.
Definition TStrings.h:25
base_type::size_type size_type
Size type of this template.
Definition TStrings.h:21
T join(const T &glue)
Joins all entries using the passed glue.
Counted vector having additional methods and operators for ease of usage. This template class extends...
Definition TVector.h:19
T & first()
Gets the first element of the vector.
T & last()
Gets the last element of the vector.
Definition Application.h:10
TStrings< std::wstring > wstring_list
Vector of std::wstrings with additional functionality.
Definition TStrings.h:101
TStrings< std::string > string_list
Vector of std::strings with additional functionality.
Definition TStrings.h:97