LLVM  6.0.0svn
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
ConvertUTF.h File Reference
#include <cstddef>
#include <string>
Include dependency graph for ConvertUTF.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  llvm::ArrayRef< T >
 ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory), i.e. More...
 
class  llvm::SmallVectorImpl< T >
 This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter. More...
 

Namespaces

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 

Macros

#define UNI_REPLACEMENT_CHAR   (UTF32)0x0000FFFD
 
#define UNI_MAX_BMP   (UTF32)0x0000FFFF
 
#define UNI_MAX_UTF16   (UTF32)0x0010FFFF
 
#define UNI_MAX_UTF32   (UTF32)0x7FFFFFFF
 
#define UNI_MAX_LEGAL_UTF32   (UTF32)0x0010FFFF
 
#define UNI_MAX_UTF8_BYTES_PER_CODE_POINT   4
 
#define UNI_UTF16_BYTE_ORDER_MARK_NATIVE   0xFEFF
 
#define UNI_UTF16_BYTE_ORDER_MARK_SWAPPED   0xFFFE
 

Typedefs

typedef unsigned int llvm::UTF32
 
typedef unsigned short llvm::UTF16
 
typedef unsigned char llvm::UTF8
 
typedef unsigned char llvm::Boolean
 

Enumerations

enum  llvm::ConversionResult { llvm::conversionOK, llvm::sourceExhausted, llvm::targetExhausted, llvm::sourceIllegal }
 
enum  llvm::ConversionFlags { llvm::strictConversion = 0, llvm::lenientConversion }
 

Functions

ConversionResult llvm::ConvertUTF8toUTF16 (const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags)
 
ConversionResult llvm::ConvertUTF8toUTF32Partial (const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags)
 Convert a partial UTF8 sequence to UTF32. More...
 
ConversionResult llvm::ConvertUTF8toUTF32 (const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags)
 Convert a partial UTF8 sequence to UTF32. More...
 
ConversionResult llvm::ConvertUTF16toUTF8 (const UTF16 **sourceStart, const UTF16 *sourceEnd, UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags)
 
ConversionResult llvm::ConvertUTF32toUTF8 (const UTF32 **sourceStart, const UTF32 *sourceEnd, UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags)
 
ConversionResult llvm::ConvertUTF16toUTF32 (const UTF16 **sourceStart, const UTF16 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags)
 
ConversionResult llvm::ConvertUTF32toUTF16 (const UTF32 **sourceStart, const UTF32 *sourceEnd, UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags)
 
Boolean llvm::isLegalUTF8Sequence (const UTF8 *source, const UTF8 *sourceEnd)
 
Boolean llvm::isLegalUTF8String (const UTF8 **source, const UTF8 *sourceEnd)
 
unsigned llvm::getNumBytesForUTF8 (UTF8 firstByte)
 
bool llvm::ConvertUTF8toWide (unsigned WideCharWidth, llvm::StringRef Source, char *&ResultPtr, const UTF8 *&ErrorPtr)
 Convert an UTF8 StringRef to UTF8, UTF16, or UTF32 depending on WideCharWidth. More...
 
bool llvm::ConvertUTF8toWide (llvm::StringRef Source, std::wstring &Result)
 Converts a UTF-8 StringRef to a std::wstring. More...
 
bool llvm::ConvertUTF8toWide (const char *Source, std::wstring &Result)
 Converts a UTF-8 C-string to a std::wstring. More...
 
bool llvm::convertWideToUTF8 (const std::wstring &Source, std::string &Result)
 Converts a std::wstring to a UTF-8 encoded std::string. More...
 
bool llvm::ConvertCodePointToUTF8 (unsigned Source, char *&ResultPtr)
 Convert an Unicode code point to UTF8 sequence. More...
 
static ConversionResult llvm::convertUTF8Sequence (const UTF8 **source, const UTF8 *sourceEnd, UTF32 *target, ConversionFlags flags)
 Convert the first UTF8 sequence in the given source buffer to a UTF32 code point. More...
 
bool llvm::hasUTF16ByteOrderMark (ArrayRef< char > SrcBytes)
 Returns true if a blob of text starts with a UTF-16 big or little endian byte order mark. More...
 
bool llvm::convertUTF16ToUTF8String (ArrayRef< char > SrcBytes, std::string &Out)
 Converts a stream of raw bytes assumed to be UTF16 into a UTF8 std::string. More...
 
bool llvm::convertUTF16ToUTF8String (ArrayRef< UTF16 > Src, std::string &Out)
 Converts a UTF16 string into a UTF8 std::string. More...
 
bool llvm::convertUTF8ToUTF16String (StringRef SrcUTF8, SmallVectorImpl< UTF16 > &DstUTF16)
 Converts a UTF-8 string into a UTF-16 string with native endianness. More...
 

Macro Definition Documentation

◆ UNI_MAX_BMP

#define UNI_MAX_BMP   (UTF32)0x0000FFFF

Definition at line 116 of file ConvertUTF.h.

Referenced by llvm::ConvertUTF32toUTF16(), and llvm::ConvertUTF8toUTF16().

◆ UNI_MAX_LEGAL_UTF32

#define UNI_MAX_LEGAL_UTF32   (UTF32)0x0010FFFF

◆ UNI_MAX_UTF16

#define UNI_MAX_UTF16   (UTF32)0x0010FFFF

Definition at line 117 of file ConvertUTF.h.

Referenced by llvm::ConvertUTF8toUTF16().

◆ UNI_MAX_UTF32

#define UNI_MAX_UTF32   (UTF32)0x7FFFFFFF

Definition at line 118 of file ConvertUTF.h.

◆ UNI_MAX_UTF8_BYTES_PER_CODE_POINT

#define UNI_MAX_UTF8_BYTES_PER_CODE_POINT   4

Definition at line 121 of file ConvertUTF.h.

Referenced by llvm::convertUTF16ToUTF8String(), and llvm::convertWideToUTF8().

◆ UNI_REPLACEMENT_CHAR

#define UNI_REPLACEMENT_CHAR   (UTF32)0x0000FFFD

◆ UNI_UTF16_BYTE_ORDER_MARK_NATIVE

#define UNI_UTF16_BYTE_ORDER_MARK_NATIVE   0xFEFF

Definition at line 123 of file ConvertUTF.h.

Referenced by llvm::convertUTF16ToUTF8String().

◆ UNI_UTF16_BYTE_ORDER_MARK_SWAPPED

#define UNI_UTF16_BYTE_ORDER_MARK_SWAPPED   0xFFFE