15#ifndef LLVM_CLANG_LIB_FORMAT_ENCODING_H
16#define LLVM_CLANG_LIB_FORMAT_ENCODING_H
19#include "llvm/Support/ConvertUTF.h"
20#include "llvm/Support/Unicode.h"
34 const llvm::UTF8 *Ptr =
reinterpret_cast<const llvm::UTF8 *
>(
Text.begin());
35 const llvm::UTF8 *BufEnd =
reinterpret_cast<const llvm::UTF8 *
>(
Text.end());
36 if (llvm::isLegalUTF8String(&Ptr, BufEnd))
46 int ContentWidth = llvm::sys::unicode::columnWidthUTF8(
Text);
51 if (ContentWidth >= 0)
62 unsigned TotalWidth = 0;
63 StringRef Tail =
Text;
65 StringRef::size_type TabPos = Tail.find(
'\t');
66 if (TabPos == StringRef::npos)
71 Tail = Tail.substr(TabPos + 1);
80 return llvm::getNumBytesForUTF8(FirstChar);
86inline bool isOctDigit(
char c) {
return '0' <= c && c <=
'7'; }
89 return (
'0' <= c && c <=
'9') || (
'a' <= c && c <=
'f') ||
90 (
'A' <= c && c <=
'F');
97 assert(
Text[0] ==
'\\');
119 return 1 + llvm::getNumBytesForUTF8(
Text[1]);
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
The JSON file list parser is used to communicate input to InstallAPI.
unsigned TabWidth
The number of columns used for tab stops.