softwarecontainer  0.18.0-739e8d7 2017-05-04
containerutilityinterface.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Pelagicore AB
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
9  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
10  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
11  * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
12  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
13  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
14  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
15  * SOFTWARE.
16  *
17  * For further information see LICENSE
18  */
19 
24 #pragma once
25 
26 #include "softwarecontainer-log.h"
27 #include "softwarecontainererror.h"
28 #include "config/config.h"
29 #include "filetoolkitwithundo.h"
30 
31 #include <memory>
32 
33 namespace softwarecontainer {
34 
43 {
44 public:
46  m_message("SoftwareContainer error")
47  {
48  }
49 
50  ContainerUtilityInterfaceError(const std::string &message):
51  m_message(message)
52  {
53  }
54 
55  virtual const char *what() const throw()
56  {
57  return m_message.c_str();
58  }
59 
60 protected:
61  std::string m_message;
62 };
63 
64 /*
65  * This class contains utility functions
66  */
67 
69 {
70  LOG_DECLARE_CLASS_CONTEXT("CUI", "Container Utility Interface");
71 public:
72  ContainerUtilityInterface(std::shared_ptr<Config> config);
73  virtual ~ContainerUtilityInterface() {}
74 
78  void removeOldContainers(void);
82  void checkWorkspace(void);
83 
84 private:
85  std::shared_ptr<Config> m_config;
86 };
87 
88 } //namespace
89 
An error occured in ContainerUtilityInterface.
Developers guide to adding a config item: