-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfmap_utils.h
38 lines (29 loc) · 992 Bytes
/
fmap_utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// This file contains wrapper of fmap functions.
#ifndef HAMMERD_FMAP_UTILS_H_
#define HAMMERD_FMAP_UTILS_H_
#include <fmap.h>
#include <stdint.h>
#include <string>
#include <base/macros.h>
namespace hammerd {
class FmapInterface {
public:
virtual ~FmapInterface() = default;
virtual int64_t Find(const uint8_t* image, unsigned int len) = 0;
virtual const fmap_area* FindArea(const fmap* fmap,
const std::string& name) = 0;
};
class Fmap : public FmapInterface {
public:
Fmap() = default;
Fmap(const Fmap&) = delete;
Fmap& operator=(const Fmap&) = delete;
int64_t Find(const uint8_t* image, unsigned int len) override;
const fmap_area* FindArea(const fmap* fmap, const std::string& name) override;
};
} // namespace hammerd
#endif // HAMMERD_FMAP_UTILS_H_