Coverage Report

Created: 2026-11-12 06:35

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/WasmEdge/include/ast/component/export.h
Line
Count
Source
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: Copyright The WasmEdge Authors
3
4
//===-- wasmedge/ast/component/export.h - Export class definition ---------===//
5
//
6
// Part of the WasmEdge Project.
7
//
8
//===----------------------------------------------------------------------===//
9
///
10
/// \file
11
/// This file contains the declaration of the Export node class.
12
///
13
//===----------------------------------------------------------------------===//
14
#pragma once
15
16
#include "ast/component/sort.h"
17
#include "ast/component/type.h"
18
#include "common/span.h"
19
20
#include <optional>
21
#include <string>
22
#include <vector>
23
24
namespace WasmEdge {
25
namespace AST {
26
namespace Component {
27
28
// export ::= na:<nameattributes> si:<sortidx> et?:<externtype>?
29
//          => (export na si et?)
30
31
/// AST Component::Export node.
32
class Export {
33
public:
34
4.27k
  std::string &getName() noexcept { return Name; }
35
8.22k
  std::string_view getName() const noexcept { return Name; }
36
4.22k
  SortIndex &getSortIndex() noexcept { return SortIdx; }
37
11.3k
  const SortIndex &getSortIndex() const noexcept { return SortIdx; }
38
4.20k
  std::optional<ExternDesc> &getDesc() noexcept { return Desc; }
39
2.62k
  const std::optional<ExternDesc> &getDesc() const noexcept { return Desc; }
40
4.27k
  std::vector<std::string> &getImplements() noexcept { return Implements; }
41
2.71k
  Span<const std::string> getImplements() const noexcept { return Implements; }
42
4.27k
  std::vector<std::string> &getExternalIds() noexcept { return ExternalIds; }
43
0
  Span<const std::string> getExternalIds() const noexcept {
44
0
    return ExternalIds;
45
0
  }
46
4.27k
  std::vector<std::string> &getVersionSuffixes() noexcept {
47
4.27k
    return VersionSuffixes;
48
4.27k
  }
49
2.71k
  Span<const std::string> getVersionSuffixes() const noexcept {
50
2.71k
    return VersionSuffixes;
51
2.71k
  }
52
53
private:
54
  std::string Name;
55
  SortIndex SortIdx;
56
  std::optional<ExternDesc> Desc;
57
  std::vector<std::string> Implements;
58
  std::vector<std::string> ExternalIds;
59
  std::vector<std::string> VersionSuffixes;
60
};
61
62
} // namespace Component
63
} // namespace AST
64
} // namespace WasmEdge