LLVM 20.0.0git
ArchiveYAML.h
Go to the documentation of this file.
1//===- ArchiveYAML.h - Archive YAMLIO implementation ------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file declares classes for handling the YAML representation of archives.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_OBJECTYAML_ARCHIVEYAML_H
15#define LLVM_OBJECTYAML_ARCHIVEYAML_H
16
19#include "llvm/ADT/MapVector.h"
20#include <optional>
21
22namespace llvm {
23namespace ArchYAML {
24
25struct Archive {
26 struct Child {
27 struct Field {
28 Field() = default;
33 unsigned MaxLength;
34 };
35
37 Fields["Name"] = {"", 16};
38 Fields["LastModified"] = {"0", 12};
39 Fields["UID"] = {"0", 6};
40 Fields["GID"] = {"0", 6};
41 Fields["AccessMode"] = {"0", 8};
42 Fields["Size"] = {"0", 10};
43 Fields["Terminator"] = {"`\n", 2};
44 }
45
47
48 std::optional<yaml::BinaryRef> Content;
49 std::optional<llvm::yaml::Hex8> PaddingByte;
50 };
51
53 std::optional<std::vector<Child>> Members;
54 std::optional<yaml::BinaryRef> Content;
55};
56
57} // end namespace ArchYAML
58} // end namespace llvm
59
61
62namespace llvm {
63namespace yaml {
64
65template <> struct MappingTraits<ArchYAML::Archive> {
66 static void mapping(IO &IO, ArchYAML::Archive &A);
67 static std::string validate(IO &, ArchYAML::Archive &A);
68};
69
70template <> struct MappingTraits<ArchYAML::Archive::Child> {
71 static void mapping(IO &IO, ArchYAML::Archive::Child &C);
72 static std::string validate(IO &, ArchYAML::Archive::Child &C);
73};
74
75} // end namespace yaml
76} // end namespace llvm
77
78#endif // LLVM_OBJECTYAML_ARCHIVEYAML_H
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
This file implements a map that provides insertion order iteration.
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
This class implements a map that also provides access to all stored values in a deterministic order.
Definition: MapVector.h:36
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ Length
Definition: DWP.cpp:480
@ Default
The result values are uniform if and only if all operands are uniform.
Field(StringRef Default, unsigned Length)
Definition: ArchiveYAML.h:29
std::optional< yaml::BinaryRef > Content
Definition: ArchiveYAML.h:48
std::optional< llvm::yaml::Hex8 > PaddingByte
Definition: ArchiveYAML.h:49
MapVector< StringRef, Field > Fields
Definition: ArchiveYAML.h:46
std::optional< yaml::BinaryRef > Content
Definition: ArchiveYAML.h:54
std::optional< std::vector< Child > > Members
Definition: ArchiveYAML.h:53