[Archive] Fix for retrieving virtual roots
[platform/core/api/webapi-plugins.git] / src / archive / archive_instance.h
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
17 #ifndef ARCHIVE_ARCHIVE_INSTANCE_H_
18 #define ARCHIVE_ARCHIVE_INSTANCE_H_
19
20 #include "common/extension.h"
21 #include "common/platform_exception.h"
22 #include "common/platform_result.h"
23
24 namespace extension {
25 namespace archive {
26
27 class ArchiveInstance : public common::ParsedInstance {
28  public:
29   ArchiveInstance();
30   virtual ~ArchiveInstance();
31
32  private:
33   ArchiveInstance(ArchiveInstance const&);
34   void operator=(ArchiveInstance const&);
35
36   /* ArchiveManager methods */
37   void Open(const picojson::value& args, picojson::object& out);
38   void Abort(const picojson::value& args, picojson::object& out);
39
40   /* ArchiveFile methods */
41   void Add(const picojson::value& args, picojson::object& out);
42   void ExtractAll(const picojson::value& args, picojson::object& out);
43   void GetEntries(const picojson::value& args, picojson::object& out);
44   void GetEntryByName(const picojson::value& args, picojson::object& out);
45   void Close(const picojson::value& args, picojson::object& out);
46
47   /* ArchiveFileEntry methods */
48   void Extract(const picojson::value& args, picojson::object& out);
49
50   /* Filesystem related method */
51   void FetchStorages(const picojson::value& args, picojson::object& out);
52
53   void PostError(const common::PlatformException& e, double callback_id);
54   void PostError(const common::PlatformResult& e, double callback_id);
55 };
56
57 }  // namespace archive
58 }  // namespace extension
59
60 #endif  // ARCHIVE_ARCHIVE_INSTANCE_H_