clang API Documentation

Namespaces | Enumerations | Functions
Encoding.h File Reference

Contains functions for text encoding manipulation. Supports UTF-8, 8-bit encodings and escape sequences in C++ string literals. More...

#include "clang/Basic/LLVM.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Unicode.h"
Include dependency graph for Encoding.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  clang
namespace  clang::format
namespace  clang::format::encoding

Enumerations

enum  clang::format::encoding::Encoding { clang::format::encoding::Encoding_UTF8, clang::format::encoding::Encoding_Unknown }

Functions

Encoding clang::format::encoding::detectEncoding (StringRef Text)
 Detects encoding of the Text. If the Text can be decoded using UTF-8, it is considered UTF8, otherwise we treat it as some 8-bit encoding.
unsigned clang::format::encoding::getCodePointCountUTF8 (StringRef Text)
unsigned clang::format::encoding::getCodePointCount (StringRef Text, Encoding Encoding)
 Gets the number of code points in the Text using the specified Encoding.
unsigned clang::format::encoding::columnWidth (StringRef Text, Encoding Encoding)
 Returns the number of columns required to display the Text on a generic Unicode-capable terminal. Text is assumed to use the specified Encoding.
unsigned clang::format::encoding::columnWidthWithTabs (StringRef Text, unsigned StartColumn, unsigned TabWidth, Encoding Encoding)
 Returns the number of columns required to display the Text, starting from the StartColumn on a terminal with the TabWidth. The text is assumed to use the specified Encoding.
unsigned clang::format::encoding::getCodePointNumBytes (char FirstChar, Encoding Encoding)
 Gets the number of bytes in a sequence representing a single codepoint and starting with FirstChar in the specified Encoding.
bool clang::format::encoding::isOctDigit (char c)
bool clang::format::encoding::isHexDigit (char c)
unsigned clang::format::encoding::getEscapeSequenceLength (StringRef Text)
 Gets the length of an escape sequence inside a C++ string literal. Text should span from the beginning of the escape sequence (starting with a backslash) to the end of the string literal.

Detailed Description

Contains functions for text encoding manipulation. Supports UTF-8, 8-bit encodings and escape sequences in C++ string literals.

Definition in file Encoding.h.