FLANG
Fortran::evaluate::value::CharacterValueImpl Class Reference

Public Member Functions

 CharacterValueImpl (const CharacterValueImpl &)=default
 CharacterValueImpl (CharacterValueImpl &&)=default
CharacterValueImpl & operator= (const CharacterValueImpl &)=default
CharacterValueImpl & operator= (CharacterValueImpl &&)=default
 CharacterValueImpl (int kind, std::string s)
 CharacterValueImpl (int kind, std::u16string s)
 CharacterValueImpl (int kind, std::u32string s)
 CharacterValueImpl (int kind, std::size_t n, char32_t c)
 Fill constructors: create a string of n copies of the given character.
void print (llvm::raw_ostream &os) const
LLVM_DUMP_METHOD void dump () const
std::optional< llvm::StringRef > AsStringRef () const
std::optional< std::string > AsStdString () const
 Return the string as std::string if kind==1, or nullopt otherwise.
std::optional< std::u16string > AsU16String () const
std::optional< std::u32string > AsU32String () const
std::string ToStdString () const
bool IsNull () const
int kind () const
std::size_t charSize () const
 Byte size of one character unit (1, 2, or 4).
std::size_t size () const
 Number of characters in this string.
std::size_t length () const
 String length (synonym for size()).
bool empty () const
 True when the string is empty.
void * data ()
 Raw byte pointer to the underlying character data.
const void * data () const
void * charData ()
const void * charData () const
Ordering Compare (const CharacterValueImpl &y) const
bool operator< (const CharacterValueImpl &y) const
bool operator<= (const CharacterValueImpl &y) const
bool operator== (const CharacterValueImpl &y) const
bool operator!= (const CharacterValueImpl &y) const
bool operator>= (const CharacterValueImpl &y) const
bool operator> (const CharacterValueImpl &y) const
void assign (int kind, std::size_t n, char32_t c)
 Assign n copies of the given character.
void assign (const char *p, std::size_t n)
 Assign from a raw character pointer and length.
void assign (const char16_t *p, std::size_t n)
void assign (const char32_t *p, std::size_t n)
void erase (std::size_t pos)
 Erase from position pos to end.
void append (std::size_t n, char32_t c)
 Append n copies of the given character.
CharacterValueImpl & replace (std::size_t pos, std::size_t len, const CharacterValueImpl &other)
 Replace the substring [pos, pos+len) with characters from other.
CharacterValueImpl substr (std::size_t pos) const
 Return a suffix starting at pos.
CharacterValueImpl substr (std::size_t pos, std::size_t len) const
 Return a substring of len characters starting at pos.
CharacterValueImpl ToAscii (int kind) const
void reserve (std::size_t n)
 Reserve storage for at least n characters.
char32_t operator[] (std::size_t i) const
 Return the character at position i as char32_t (safe for all kinds).
CharacterValueImpl operator+ (const CharacterValueImpl &y) const
 Concatenate two same-kind strings.
CharacterValueImpl & operator+= (const CharacterValueImpl &y)
 Append another same-kind string.
CharacterValueImpl & operator+= (char32_t c)
 Append a character, converting it to the string's element type.
std::size_t find (const CharacterValueImpl &pattern) const
std::size_t rfind (const CharacterValueImpl &pattern) const
std::size_t find_first_not_of (char c) const
std::size_t find_first_not_of (char16_t c) const
std::size_t find_first_not_of (char32_t c) const
std::size_t find_last_not_of (char c) const
std::size_t find_last_not_of (char16_t c) const
std::size_t find_last_not_of (char32_t c) const
std::size_t find_first_not_of (const CharacterValueImpl &set) const
std::size_t find_last_not_of (const CharacterValueImpl &set) const
std::size_t find_first_of (const CharacterValueImpl &set) const
std::size_t find_last_of (const CharacterValueImpl &set) const
void StoreRawBytes (void *dst, std::size_t size, bool *changed=nullptr) const
template<typename CharT, typename = std::void_t<std::basic_string<CharT>>>
const std::basic_string< CharT > & GetBasicString () const
template<typename F>
auto WithCharProto (F &&f) const -> decltype(std::declval< F >()(std::declval< char >()))
template<typename F>
auto WithBasicString (F &&f) const -> decltype(f(std::declval< const std::string & >()))

Static Public Member Functions

static CharacterValueImpl Zero (int kind)
static CharacterValueImpl FromRawBytes (int kind, const void *raw, size_t byteSize)
template<typename F>
static auto WithCharProto (int kind, F &&f) -> decltype(std::declval< F >()(std::declval< char >()))

Static Public Attributes

static constexpr std::size_t npos {std::string::npos}
 Sentinel value for "not found" positions (same as std::string::npos).

The documentation for this class was generated from the following files: