~unity-api-team/unity-scopes-api/child-scopes-option

« back to all changes in this revision

Viewing changes to src/internal/ScopeConfig.cpp

  • Committer: Michi Henning
  • Date: 2013-11-19 02:51:46 UTC
  • mto: This revision was merged to the branch mainline in revision 62.
  • Revision ID: michi.henning@canonical.com-20131119025146-kglcalpphl4ozzk7
Fixed scoperegistry to use new scoperunner and to figure out which scopes to run from config files.
Still to do:
- deal with overrides and OEM scopes, particularly the grouping aspect.
- SignalThread needs to invoke a callback for clean shut-down on receipt of SIGINT.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2013 Canonical Ltd
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License version 3 as
 
6
 * published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authored by: Michi Henning <michi.henning@canonical.com>
 
17
 */
 
18
 
 
19
#include <scopes/internal/ScopeConfig.h>
 
20
 
 
21
#include <unity/UnityExceptions.h>
 
22
 
 
23
using namespace std;
 
24
 
 
25
namespace unity
 
26
{
 
27
 
 
28
namespace api
 
29
{
 
30
 
 
31
namespace scopes
 
32
{
 
33
 
 
34
namespace internal
 
35
{
 
36
 
 
37
namespace
 
38
{
 
39
    const string overrideable_str = "Override";
 
40
}
 
41
 
 
42
ScopeConfig::ScopeConfig(string const& configfile) :
 
43
    ConfigBase(configfile)
 
44
{
 
45
    try
 
46
    {
 
47
        overrideable_ = parser()->get_boolean(SCOPE_CONFIG_GROUP, overrideable_str);
 
48
    }
 
49
    catch (LogicException const&)
 
50
    {
 
51
        overrideable_ = false;
 
52
    }
 
53
}
 
54
 
 
55
ScopeConfig::~ScopeConfig() noexcept
 
56
{
 
57
}
 
58
 
 
59
bool ScopeConfig::overrideable() const
 
60
{
 
61
    return overrideable_;
 
62
}
 
63
 
 
64
} // namespace internal
 
65
 
 
66
} // namespace scopes
 
67
 
 
68
} // namespace api
 
69
 
 
70
} // namespace unity