2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

libconfig.cpp 2.06 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//================================================================================
// Name        : libconfig.cpp
// Author      : Michael Ott
// Contact     : info@dcdb.it
// Copyright   : Leibniz Supercomputing Centre
// Description : C++ API for configuring libdcdb.
//================================================================================

//================================================================================
// This file is part of DCDB (DataCenter DataBase)
// Copyright (C) 2011-2019 Leibniz Supercomputing Centre
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
//================================================================================

/**
 * @file libconfig.cpp
 * @brief This file contains actual implementations of the LibConfig
 * interface. The interface itself forwards all functions to the internal
 * LibConfigImpl. The real logic is implemented in the LibConfigImpl.
 */

#include <dcdb/libconfig.h>

DCDB::LibConfig libConfig;

using namespace DCDB;

LibConfig::LibConfig() {
}

LibConfig::~LibConfig() {
}

void LibConfig::init() {
    _initialized = true;
}

bool LibConfig::isInitialzed() {
    return _initialized;
}

void LibConfig::setTempDir(const std::string& tempDir) {
    if (tempDir.back() == '/') {
	_tempDir = tempDir.substr(0, tempDir.size()-1);
    } else {
	_tempDir = tempDir;
    }
}

std::string& LibConfig::getTempDir() {
    return _tempDir;
}