Merge "Change registerParametricMethod/regiterNonPrametricMethod to expose" into...
[platform/core/security/ode.git] / lib / secure-erase.cpp
1 /*
2  *  Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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
15  */
16 #include "rmi/secure-erase.h"
17
18 namespace ode {
19
20 SecureErase::SecureErase(ODEControlContext& ctx) :
21         context(ctx)
22 {
23 }
24
25 SecureErase::~SecureErase()
26 {
27 }
28
29 int SecureErase::erase(const std::string& name)
30 {
31         try {
32                 return context->methodCall<int>("SecureErase::erase", name);
33         } catch (runtime::Exception& e) {
34                 return -1;
35         }
36 }
37
38 int SecureErase::clean(const std::string& name)
39 {
40         try {
41                 return context->methodCall<int>("SecureErase::clean", name);
42         } catch (runtime::Exception& e) {
43                 return -1;
44         }
45 }
46
47 } // namespace ode