libstorage-ng
Remote.h
1 /*
2  * Copyright (c) 2015 Novell, Inc.
3  *
4  * All Rights Reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of version 2 of the GNU General Public License as published
8  * by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, contact Novell, Inc.
17  *
18  * To contact Novell about this file by physical or electronic mail, you may
19  * find current contact information at www.novell.com.
20  */
21 
22 
23 #ifndef STORAGE_REMOTE_H
24 #define STORAGE_REMOTE_H
25 
26 
27 #include <string>
28 #include <vector>
29 
30 
31 // TODO the classnames are bad since the classes for also used in Mockup
32 // TODO swig does not support nested classes so here are currently ugly names
33 
34 namespace storage
35 {
36 
38  {
39  RemoteCommand() : stdout(), stderr(), exit_code(0) {}
40  RemoteCommand(const std::vector<std::string>& stdout)
41  : stdout(stdout), stderr(), exit_code(0) {}
42  RemoteCommand(const std::vector<std::string>& stdout,
43  const std::vector<std::string>& stderr, int exit_code)
44  : stdout(stdout), stderr(stderr), exit_code(exit_code) {}
45 
46  std::vector<std::string> stdout;
47  std::vector<std::string> stderr;
48  int exit_code;
49  };
50 
51 
52  struct RemoteFile
53  {
54  RemoteFile() : content() {}
55  RemoteFile(const std::vector<std::string>& content) : content(content) {}
56 
57  std::vector<std::string> content;
58  };
59 
60 
62  {
63  public:
64 
65  virtual ~RemoteCallbacks() {}
66 
67  virtual RemoteCommand get_command(const std::string& name) const = 0;
68  virtual RemoteFile get_file(const std::string& name) const = 0;
69 
70  };
71 
72  const RemoteCallbacks* get_remote_callbacks();
73  void set_remote_callbacks(const RemoteCallbacks* remote_callbacks);
74 
75 }
76 
77 
78 #endif
Definition: Remote.h:52
Definition: Remote.h:37
Definition: Remote.h:61
The storage namespace.
Definition: Actiongraph.h:37