Lines Matching full:encoding
1 //===--- Encoding.h - Format C++ code ---------------------------*- C++ -*-===//
10 /// Contains functions for text encoding manipulation. Supports UTF-8,
24 namespace encoding {
26 enum Encoding {
31 /// Detects encoding of the Text. If the Text can be decoded using UTF-8,
32 /// it is considered UTF8, otherwise we treat it as some 8-bit encoding.
33 inline Encoding detectEncoding(StringRef Text) {
43 /// \p Encoding.
44 inline unsigned columnWidth(StringRef Text, Encoding Encoding) {
45 if (Encoding == Encoding_UTF8) {
59 /// text is assumed to use the specified \p Encoding.
61 unsigned TabWidth, Encoding Encoding) {
67 return TotalWidth + columnWidth(Tail, Encoding);
68 TotalWidth += columnWidth(Tail.substr(0, TabPos), Encoding);
76 /// codepoint and starting with FirstChar in the specified Encoding.
77 inline unsigned getCodePointNumBytes(char FirstChar, Encoding Encoding) {
78 switch (Encoding) {
123 } // namespace encoding