15#ifndef LLVM_SUPPORT_TEXT_ENCODING_H
16#define LLVM_SUPPORT_TEXT_ENCODING_H
20#include "llvm/Config/config.h"
25#include <system_error>
29template <
typename T>
class SmallVectorImpl;
54 virtual std::error_code convertString(
StringRef Source,
58 virtual void reset() = 0;
65 auto EC = convertString(Source, Result);
83 std::unique_ptr<details::TextEncodingConverterImplBase> Converter;
86 std::unique_ptr<details::TextEncodingConverterImplBase>
Converter)
128 return Converter->convert(Source, Result);
133 auto EC =
Converter->convert(Source, Result);
135 return std::string(Result);
BlockVerifier::State From
Provides ErrorOr<T> smart pointer.
This file defines the SmallString class.
Represents either an error or a value T.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringRef - Represent a constant reference to a string, i.e.
Utility class to convert between different character encodings.
TextEncodingConverter(const TextEncodingConverter &)=delete
~TextEncodingConverter()=default
TextEncodingConverter & operator=(const TextEncodingConverter &)=delete
std::error_code convert(StringRef Source, SmallVectorImpl< char > &Result) const
Converts a string.
TextEncodingConverter(TextEncodingConverter &&Other)
ErrorOr< std::string > convert(StringRef Source) const
static LLVM_ABI ErrorOr< TextEncodingConverter > create(TextEncoding From, TextEncoding To)
Creates a TextEncodingConverter instance.
TextEncodingConverter & operator=(TextEncodingConverter &&Other)
virtual ~TextEncodingConverterImplBase()=default
std::error_code convert(StringRef Source, SmallVectorImpl< char > &Result)
Converts a string and resets the converter to the initial state.
This is an optimization pass for GlobalISel generic memory operations.
@ IBM1047
IBM EBCDIC 1047 character set encoding.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.