Lines Matching defs:Source

18 bool ConvertUTF8toWide(unsigned WideCharWidth, llvm::StringRef Source,
24 const UTF8 *Pos = reinterpret_cast<const UTF8*>(Source.begin());
25 if (!isLegalUTF8String(&Pos, reinterpret_cast<const UTF8*>(Source.end()))) {
29 memcpy(ResultPtr, Source.data(), Source.size());
30 ResultPtr += Source.size();
33 const UTF8 *sourceStart = (const UTF8*)Source.data();
39 ConvertUTF8toUTF16(&sourceStart, sourceStart + Source.size(),
40 &targetStart, targetStart + Source.size(), flags);
46 const UTF8 *sourceStart = (const UTF8 *)Source.data();
52 ConvertUTF8toUTF32(&sourceStart, sourceStart + Source.size(),
53 &targetStart, targetStart + Source.size(), flags);
64 bool ConvertCodePointToUTF8(unsigned Source, char *&ResultPtr) {
65 const UTF32 *SourceStart = &Source;
242 static inline bool ConvertUTF8toWideInternal(llvm::StringRef Source,
247 Result.resize(Source.size() + 1);
250 if (!ConvertUTF8toWide(sizeof(wchar_t), Source, ResultPtr, ErrorPtr)) {
258 bool ConvertUTF8toWide(llvm::StringRef Source, std::wstring &Result) {
259 return ConvertUTF8toWideInternal(Source, Result);
262 bool ConvertUTF8toWide(const char *Source, std::wstring &Result) {
263 if (!Source) {
267 return ConvertUTF8toWide(llvm::StringRef(Source), Result);
270 bool convertWideToUTF8(const std::wstring &Source, std::string &Result) {
272 const UTF8 *Start = reinterpret_cast<const UTF8 *>(Source.data());
274 reinterpret_cast<const UTF8 *>(Source.data() + Source.size());
277 Result.resize(Source.size());
278 memcpy(&Result[0], Source.data(), Source.size());
282 llvm::ArrayRef<UTF16>(reinterpret_cast<const UTF16 *>(Source.data()),
283 Source.size()),
286 const UTF32 *Start = reinterpret_cast<const UTF32 *>(Source.data());
288 reinterpret_cast<const UTF32 *>(Source.data() + Source.size());
289 Result.resize(UNI_MAX_UTF8_BYTES_PER_CODE_POINT * Source.size());