-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathCharacterVector.h
More file actions
51 lines (39 loc) · 1.31 KB
/
CharacterVector.h
File metadata and controls
51 lines (39 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef Rcpp__vector__impl_CharacterVector_h
#define Rcpp__vector__impl_CharacterVector_h
namespace Rcpp{
#define VEC Vector<STRSXP,Storage>
template <typename Storage>
class Vector<STRSXP,Storage> :
public VectorOfRTYPE<STRSXP>,
public SugarVectorExpression<String,VEC>
{
public:
typedef String value_type ;
typedef internal::string_proxy<Vector> Proxy ;
typedef internal::Proxy_Iterator<Proxy> iterator ;
typedef internal::Proxy_Iterator<Proxy> const_iterator ;
#define RTYPE STRSXP
#include <Rcpp/vector/impl/RCPP_VECTOR_API.h>
#undef RTYPE
public:
Vector( R_xlen_t n, const char* s ) {
reset(n) ;
std::fill( begin(), end(), Rf_mkChar(s) ) ;
}
Vector( const char* st ){
reset(1) ;
*begin() = st ;
}
Vector( const std::string& st ) {
reset(1) ;
*begin() = st ;
}
Vector( std::initializer_list<const char*> list ){
reset(list.size()) ;
std::copy( list.begin(), list.end(), begin() ) ;
}
#include <Rcpp/vector/impl/RCPP_VECTOR_PROXY_BASED_API.h>
} ;
#undef VEC
}
#endif