diff options
author | ThiƩbaud Weksteen <tweek@google.com> | 2020-10-23 16:06:59 +0200 |
---|---|---|
committer | ThiƩbaud Weksteen <tweek@google.com> | 2020-10-23 17:47:37 +0200 |
commit | 4848ee07bb07ebb765e6fa0561f0d90ff86bbffb (patch) | |
tree | 04fb66b6c0dedf114f02e200d8c9114f1dfa1df9 /simpleperf/read_apk.h | |
parent | cfdf96ecbd3f0814d801469504cf379140c01db3 (diff) | |
download | extras-4848ee07bb07ebb765e6fa0561f0d90ff86bbffb.tar.gz |
simpleperf: enable .clang-format
Use the 2-space configuration by default and disable any formatting for
the demo/ subdirectory. The following command was used to generate this
change:
$ find . \( -name \*.cpp -o -name \*.h \) -exec clang-format \
--style=file -i {} \;
Test: mm
Change-Id: I89ec1f18f6e352f40cfa1a770087f3b586b1d7cb
Diffstat (limited to 'simpleperf/read_apk.h')
-rw-r--r-- | simpleperf/read_apk.h | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/simpleperf/read_apk.h b/simpleperf/read_apk.h index c37366b9..2296288c 100644 --- a/simpleperf/read_apk.h +++ b/simpleperf/read_apk.h @@ -29,28 +29,20 @@ // Container for info an on ELF file embedded into an APK file class EmbeddedElf { public: - EmbeddedElf() - : entry_offset_(0) - , entry_size_(0) - { - } - - EmbeddedElf(const std::string& filepath, - const std::string& entry_name, - uint64_t entry_offset, + EmbeddedElf() : entry_offset_(0), entry_size_(0) {} + + EmbeddedElf(const std::string& filepath, const std::string& entry_name, uint64_t entry_offset, size_t entry_size) - : filepath_(filepath) - , entry_name_(entry_name) - , entry_offset_(entry_offset) - , entry_size_(entry_size) - { - } + : filepath_(filepath), + entry_name_(entry_name), + entry_offset_(entry_offset), + entry_size_(entry_size) {} // Path to APK file - const std::string &filepath() const { return filepath_; } + const std::string& filepath() const { return filepath_; } // Entry name within zip archive - const std::string &entry_name() const { return entry_name_; } + const std::string& entry_name() const { return entry_name_; } // Offset of zip entry from start of containing APK file uint64_t entry_offset() const { return entry_offset_; } @@ -59,10 +51,10 @@ class EmbeddedElf { uint32_t entry_size() const { return entry_size_; } private: - std::string filepath_; // containing APK path - std::string entry_name_; // name of entry in zip index of embedded elf file - uint64_t entry_offset_; // offset of ELF from start of containing APK file - uint32_t entry_size_; // size of ELF file in zip + std::string filepath_; // containing APK path + std::string entry_name_; // name of entry in zip index of embedded elf file + uint64_t entry_offset_; // offset of ELF from start of containing APK file + uint32_t entry_size_; // size of ELF file in zip }; // APK inspector helper class @@ -75,8 +67,8 @@ class ApkInspector { private: static std::unique_ptr<EmbeddedElf> FindElfInApkByOffsetWithoutCache(const std::string& apk_path, uint64_t file_offset); - static std::unique_ptr<EmbeddedElf> FindElfInApkByNameWithoutCache( - const std::string& apk_path, const std::string& entry_name); + static std::unique_ptr<EmbeddedElf> FindElfInApkByNameWithoutCache(const std::string& apk_path, + const std::string& entry_name); struct ApkNode { // Map from entry_offset to EmbeddedElf. |