代码拉取完成,页面将自动刷新
同步操作将从 OpenHarmony/arkcompiler_runtime_core 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/**
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LIBPANDAFILE_ANNOTATION_DATA_ACCESSOR_H
#define LIBPANDAFILE_ANNOTATION_DATA_ACCESSOR_H
#include "file.h"
#include "helpers.h"
#include "value.h"
namespace panda::panda_file {
class AnnotationDataAccessor {
public:
class Elem {
public:
Elem(const File &panda_file, File::EntityId name_id, uint32_t value)
: panda_file_(panda_file), name_id_(name_id), value_(value)
{
}
~Elem() = default;
NO_COPY_SEMANTIC(Elem);
NO_MOVE_SEMANTIC(Elem);
File::EntityId GetNameId() const
{
return name_id_;
}
ScalarValue GetScalarValue() const
{
return ScalarValue(panda_file_, value_);
}
ArrayValue GetArrayValue() const
{
return ArrayValue(panda_file_, File::EntityId(value_));
}
private:
const File &panda_file_;
File::EntityId name_id_;
uint32_t value_;
};
class Tag {
public:
explicit Tag(char item) : item_(item) {}
~Tag() = default;
NO_COPY_SEMANTIC(Tag);
NO_MOVE_SEMANTIC(Tag);
char GetItem() const
{
return item_;
}
private:
char item_;
};
AnnotationDataAccessor(const File &panda_file, File::EntityId annotation_id);
~AnnotationDataAccessor() = default;
NO_COPY_SEMANTIC(AnnotationDataAccessor);
NO_MOVE_SEMANTIC(AnnotationDataAccessor);
File::EntityId GetClassId() const
{
return File::EntityId(class_off_);
}
uint32_t GetCount() const
{
return count_;
}
Elem GetElement(size_t i) const;
Tag GetTag(size_t i) const;
size_t GetSize() const
{
return size_;
}
File::EntityId GetAnnotationId() const
{
return annotation_id_;
}
private:
static constexpr size_t COUNT_SIZE = sizeof(uint16_t);
static constexpr size_t VALUE_SIZE = sizeof(uint32_t);
static constexpr size_t TYPE_TAG_SIZE = sizeof(uint8_t);
const File &panda_file_;
File::EntityId annotation_id_;
uint32_t class_off_;
uint32_t count_;
Span<const uint8_t> elements_sp_ {nullptr, nullptr};
Span<const uint8_t> elements_tags_ {nullptr, nullptr};
size_t size_;
};
} // namespace panda::panda_file
#endif // LIBPANDAFILE_ANNOTATION_DATA_ACCESSOR_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。