Lines Matching defs:Text
32 /// \brief Detects encoding of the Text. If the Text can be decoded using UTF-8,
34 inline Encoding detectEncoding(StringRef Text) {
35 const UTF8 *Ptr = reinterpret_cast<const UTF8 *>(Text.begin());
36 const UTF8 *BufEnd = reinterpret_cast<const UTF8 *>(Text.end());
42 inline unsigned getCodePointCountUTF8(StringRef Text) {
44 for (size_t i = 0, e = Text.size(); i < e; i += getNumBytesForUTF8(Text[i])) {
50 /// \brief Gets the number of code points in the Text using the specified
52 inline unsigned getCodePointCount(StringRef Text, Encoding Encoding) {
55 return getCodePointCountUTF8(Text);
57 return Text.size();
61 /// \brief Returns the number of columns required to display the \p Text on a
62 /// generic Unicode-capable terminal. Text is assumed to use the specified
64 inline unsigned columnWidth(StringRef Text, Encoding Encoding) {
66 int ContentWidth = llvm::sys::unicode::columnWidthUTF8(Text);
74 return Text.size();
77 /// \brief Returns the number of columns required to display the \p Text,
80 inline unsigned columnWidthWithTabs(StringRef Text, unsigned StartColumn,
83 StringRef Tail = Text;
113 /// Text should span from the beginning of the escape sequence (starting with a
115 inline unsigned getEscapeSequenceLength(StringRef Text) {
116 assert(Text[0] == '\\');
117 if (Text.size() < 2)
120 switch (Text[1]) {
127 while (I < Text.size() && isHexDigit(Text[I]))
132 if (isOctDigit(Text[1])) {
134 while (I < Text.size() && I < 4 && isOctDigit(Text[I]))