2 * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include <arser/arser.h>
18 #include <circleread/Model.h>
19 #include <circledump/Dump.h>
23 int entry(int argc, char **argv)
26 arser.add_argument("circle").type(arser::DataType::STR).help("Circle file path to dump");
30 arser.parse(argc, argv);
32 catch (const std::runtime_error &err)
34 std::cout << err.what() << '\n';
39 std::string circle_path = arser.get<std::string>("circle");
40 // Load Circle model from a circle file
41 std::unique_ptr<circleread::Model> model = circleread::load_circle(circle_path);
44 std::cerr << "ERROR: Failed to load circle '" << circle_path << "'" << std::endl;
48 const circle::Model *circlemodel = model->model();
49 if (circlemodel == nullptr)
51 std::cerr << "ERROR: Failed to load circle '" << circle_path << "'" << std::endl;
55 std::cout << "Dump: " << circle_path << std::endl << std::endl;
57 std::cout << circlemodel << std::endl;