22 #ifndef Rcpp__vector__const_string_proxy_h
23 #define Rcpp__vector__const_string_proxy_h
28 template<
int RTYPE,
template <
class>
class StoragePolicy>
32 typedef typename ::Rcpp::Vector<RTYPE, StoragePolicy>
VECTOR ;
63 operator SEXP()
const {
72 operator char*()
const {
73 return const_cast<char*
>( CHAR(
get()) );
80 template <
int RT,
template <
class>
class StoragePolicy_>
83 template <
int RT,
template <
class>
class StoragePolicy_>
90 inline SEXP
get()
const {
96 inline R_xlen_t
size()
const {
return strlen(
begin() ) ; }
101 return strcmp(
begin(), other ) == 0 ;
104 return strcmp(
begin(), other ) != 0 ;
108 return strcmp(
begin(), other.
begin() ) == 0 ;
111 return strcmp(
begin(), other.
begin() ) != 0 ;
115 return get() == other;
119 return get() != other;
130 const_cast<char *
>(lhs.
begin() ),
131 const_cast<char *
>(rhs.
begin())
138 const_cast<char *
>(lhs.
begin() ),
139 const_cast<char *
>(rhs.
begin())
146 const_cast<char *
>(lhs.
begin() ),
147 const_cast<char *
>(rhs.
begin())
154 const_cast<char *
>(lhs.
begin() ),
155 const_cast<char *
>(rhs.
begin())
161 template <
template <
class>
class StoragePolicy>
163 os << static_cast<const char*>(proxy) ;
167 template <
template <
class>
class StoragePolicy>
169 return x +
static_cast<const char*
>(y) ;
172 template <
int RTYPE,
template <
class>
class StoragePolicy1>
173 template <
template <
class>
class StoragePolicy2>
bool operator==(SEXP other) const
friend std::ostream & operator<<(std::ostream &os, const const_string_proxy< RT, StoragePolicy_ > &proxy)
const_string_proxy(const const_string_proxy &other)
bool operator==(const char *other)
const_string_proxy(SEXP x)
::Rcpp::Vector< RTYPE, StoragePolicy > VECTOR
reference operator[](R_xlen_t n)
const_string_proxy(const VECTOR &v, R_xlen_t index_)
friend std::string operator+(const std::string &x, const const_string_proxy< RT, StoragePolicy_ > &proxy)
bool operator==(const const_string_proxy &other)
bool operator!=(const const_string_proxy &other)
bool operator!=(const char *other)
bool operator!=(SEXP other) const
static std::string buffer
string_proxy & operator=(const string_proxy< RTYPE, StoragePolicy > &other)
bool operator<=(const const_string_proxy< RT > &lhs, const const_string_proxy< RT > &rhs)
bool operator>=(const const_string_proxy< RT > &lhs, const const_string_proxy< RT > &rhs)
bool operator<(const const_string_proxy< RT > &lhs, const const_string_proxy< RT > &rhs)
std::ostream & operator<<(std::ostream &os, const const_string_proxy< STRSXP, StoragePolicy > &proxy)
std::string operator+(const std::string &x, const const_string_proxy< STRSXP, StoragePolicy > &y)
bool operator>(const const_string_proxy< RT > &lhs, const const_string_proxy< RT > &rhs)