acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
_array_string.h
1// From RedDotLogics/utils by camilo on 2023-05-18 19:46 <3ThomasBorregaardSorensen!!
2#pragma once
3
4
5namespace generic
6{
7
8
9 namespace array
10 {
11
12
13 template < typename ARRAY >
14 inline ARRAY from_string(const ::scoped_string& scopedstr)
15 {
16
17 static_assert(::prototype_integral<typename Container::BASE_TYPE>, "Integer containter expected.");
18
19 ::tokenizer tokenizer(scopedstrPayload);
20
21 ARRAY array;
22
23 ::string strToken;
24
25 while (tokenizer.get_next_token(strToken, "|"))
26 {
27
28 array.add(atoi(strToken));
29
30 }
31
32 return array;
33
34 }
35
36
37 } // namespace array
38
39
40} // namespace generic
41
42