10# pragma clang diagnostic push
11# pragma clang diagnostic ignored "-Wexit-time-destructors"
31 StringRef::operator std::string()
const {
32 return std::string( m_start, m_size );
43 const_cast<StringRef*
>( this )->takeOwnership();
50 auto StringRef::isOwned() const noexcept ->
bool {
51 return m_data !=
nullptr;
53 auto StringRef::isSubstring() const noexcept ->
bool {
54 return m_start[m_size] !=
'\0';
57 void StringRef::takeOwnership() {
59 m_data =
new char[m_size+1];
60 memcpy( m_data, m_start, m_size );
61 m_data[m_size] =
'\0';
73 size() == other.size() &&
74 (std::strncmp( m_start, other.m_start, size() ) == 0);
81 return m_start[index];
89 if( ( c & byte_2_lead ) == byte_2_lead ) {
91 if (( c & byte_3_lead ) == byte_3_lead )
93 if( ( c & byte_4_lead ) == byte_4_lead )
102 str.reserve( lhs.size() + rhs.size() );
108 return std::string( lhs ) + std::string( rhs );
111 return std::string( lhs ) + std::string( rhs );
115 return os.write(str.currentData(), str.size());
119 lhs.append(rhs.currentData(), rhs.size());
125#if defined(__clang__)
126# pragma clang diagnostic pop
auto c_str() const -> char const *
auto substr(size_type start, size_type size) const noexcept -> StringRef
auto operator[](size_type index) const noexcept -> char
auto numberOfCharacters() const noexcept -> size_type
void swap(StringRef &other) noexcept
auto operator!=(StringRef const &other) const noexcept -> bool
auto operator==(StringRef const &other) const noexcept -> bool
auto currentData() const noexcept -> char const *
GenericStringRef< CharType > StringRef(const CharType *str)
Mark a character pointer as constant string.
bool operator==(const environment &other)
T const & operator+(T const &value, StreamEndStop)
auto operator+=(std::string &lhs, StringRef const &rhs) -> std::string &
auto operator<<(std::ostream &os, LazyExpression const &lazyExpr) -> std::ostream &
void swap(picojson::value &x, picojson::value &y)
memcpy((char *) pInfo->slotDescription, s, l)