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