LLVM: include/llvm/ObjectYAML/YAML.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9#ifndef LLVM_OBJECTYAML_YAML_H

10#define LLVM_OBJECTYAML_YAML_H

11

16#include

17

18namespace llvm {

19

21

22namespace yaml {

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

66

67

68

70

71

72 bool DataIsHexString = true;

73

74public:

78

79

80

82 if (DataIsHexString)

83 return Data.size() / 2;

84 return Data.size();

85 }

86

87

88

89

91

92

93

94

95

97};

98

100

101 if (LHS.Data.empty() && RHS.Data.empty())

102 return true;

103

104 return LHS.DataIsHexString == RHS.DataIsHexString && LHS.Data == RHS.Data;

105}

106

112

113}

114

115}

116

117#endif

ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...

size_t size() const

size - Get the array size.

StringRef - Represent a constant reference to a string, i.e.

This class implements an extremely fast bulk output stream that can only output to a stream.

Specialized YAMLIO scalar type for representing a binary blob.

Definition YAML.h:64

ArrayRef< uint8_t >::size_type binary_size() const

The number of bytes that are represented by this BinaryRef.

Definition YAML.h:81

BinaryRef(StringRef Data)

Definition YAML.h:77

friend bool operator==(const BinaryRef &LHS, const BinaryRef &RHS)

Definition YAML.h:99

BinaryRef(ArrayRef< uint8_t > Data)

Definition YAML.h:76

LLVM_ABI void writeAsHex(raw_ostream &OS) const

Write the contents (regardless of whether it is binary or a hex string) as hex to the given raw_ostre...

LLVM_ABI void writeAsBinary(raw_ostream &OS, uint64_t N=UINT64_MAX) const

Write the contents (regardless of whether it is binary or a hex string) as binary to the given raw_os...

bool operator==(const BinaryRef &LHS, const BinaryRef &RHS)

Definition YAML.h:99

QuotingType

Describe which type of quotes should be used when quoting is necessary.

QuotingType needsQuotes(StringRef S, bool ForcePreserveAsString=true)

This is an optimization pass for GlobalISel generic memory operations.

ArrayRef< CharT > arrayRefFromStringRef(StringRef Input)

Construct a string ref from an array ref of unsigned chars.

static LLVM_ABI void output(const BinaryRef &, void *, raw_ostream &)

static LLVM_ABI StringRef input(StringRef, void *, BinaryRef &)

static QuotingType mustQuote(StringRef S)

Definition YAML.h:110

This class should be specialized by type that requires custom conversion to/from a yaml scalar.