comparison clang-tools-extra/clangd/RIFF.h @ 221:79ff65ed7e25

LLVM12 Original
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 15 Jun 2021 19:15:29 +0900
parents 1d019706d866
children c4bab56944e8
comparison
equal deleted inserted replaced
220:42394fc6a535 221:79ff65ed7e25
42 using FourCC = std::array<char, 4>; 42 using FourCC = std::array<char, 4>;
43 // Get a FourCC from a string literal, e.g. fourCC("RIFF"). 43 // Get a FourCC from a string literal, e.g. fourCC("RIFF").
44 inline constexpr FourCC fourCC(const char (&Literal)[5]) { 44 inline constexpr FourCC fourCC(const char (&Literal)[5]) {
45 return FourCC{{Literal[0], Literal[1], Literal[2], Literal[3]}}; 45 return FourCC{{Literal[0], Literal[1], Literal[2], Literal[3]}};
46 } 46 }
47 inline constexpr llvm::StringRef fourCCStr(const FourCC &Data) {
48 return llvm::StringRef(&Data[0], Data.size());
49 }
47 // A chunk is a section in a RIFF container. 50 // A chunk is a section in a RIFF container.
48 struct Chunk { 51 struct Chunk {
49 FourCC ID; 52 FourCC ID;
50 llvm::StringRef Data; 53 llvm::StringRef Data;
51 }; 54 };