Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

open-axiom repository from github

24005 views
1
// Copyright (C) 2011, Gabriel Dos Reis.
2
// All rights reserved.
3
//
4
// Redistribution and use in source and binary forms, with or without
5
// modification, are permitted provided that the following conditions are
6
// met:
7
//
8
// - Redistributions of source code must retain the above copyright
9
// notice, this list of conditions and the following disclaimer.
10
//
11
// - Redistributions in binary form must reproduce the above copyright
12
// notice, this list of conditions and the following disclaimer in
13
// the documentation and/or other materials provided with the
14
// distribution.
15
//
16
// - Neither the name of The Numerical Algorithms Group Ltd. nor the
17
// names of its contributors may be used to endorse or promote products
18
// derived from this software without specific prior written permission.
19
//
20
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
24
// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
32
// --% Author: Gabriel Dos Reis.
33
34
35
#include "open-axiom.h"
36
37
namespace OpenAxiom {
38
Filesystem::Filesystem(const std::string& d)
39
: root(d),
40
alg(d + "/algebra"),
41
db(alg)
42
{ }
43
44
std::string Filesystem::sysdir() const { return root; }
45
46
std::string Filesystem::algdir() const { return alg; }
47
48
std::string Filesystem::dbdir() const { return db; }
49
50
std::string
51
database_filepath(const Filesystem& fs, const std::string& file) {
52
return fs.dbdir() + "/" + file + ".daase";
53
}
54
}
55
56