• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 
17 #include "executor/version_dumper.h"
18 
19 namespace OHOS {
20 namespace HiviewDFX {
21 static constexpr auto& VERSION_DUMPER_VERSION_STRING = "HiDumper version:0.8.8";
22 
VersionDumper()23 VersionDumper::VersionDumper()
24 {
25 }
26 
~VersionDumper()27 VersionDumper::~VersionDumper()
28 {
29 }
30 
PreExecute(const std::shared_ptr<DumperParameter> & parameter,StringMatrix dumpDatas)31 DumpStatus VersionDumper::PreExecute(const std::shared_ptr<DumperParameter>& parameter,
32     StringMatrix dumpDatas)
33 {
34     if (dumpDatas.get()) {
35         result_ = dumpDatas;
36         return DumpStatus::DUMP_OK;
37     }
38     return DumpStatus::DUMP_FAIL;
39 }
40 
Execute()41 DumpStatus VersionDumper::Execute()
42 {
43     std::vector<std::string> line_vector;
44     line_vector.push_back(VERSION_DUMPER_VERSION_STRING);
45     result_->push_back(line_vector);
46     return DumpStatus::DUMP_OK;
47 }
48 
AfterExecute()49 DumpStatus VersionDumper::AfterExecute()
50 {
51     return DumpStatus::DUMP_OK;
52 }
53 } // namespace HiviewDFX
54 } // namespace OHOS
55