Octopus
share_directory.hpp
Go to the documentation of this file.
1#ifndef PSEUDO_SHARE_DIRECTORY_HPP
2#define PSEUDO_SHARE_DIRECTORY_HPP
3
4/*
5 Copyright (C) 2018 Xavier Andrade
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20*/
21
22#include <string>
23#include "config.h"
24
25namespace pseudopotential {
26
27class share_directory {
28
29public:
30 static void set(const std::string &dir) { directory() = dir; }
31
32 static std::string get() {
33 if (directory().size() != 0)
34 return directory();
35 return SHARE_DIR;
36 }
37
38private:
39 static std::string &directory() {
40 static std::string directory_;
41 return directory_;
42 }
43};
44
45} // namespace pseudopotential
46
47#endif
48
49// Local Variables:
50// mode: c++
51// coding: utf-8
52// End:
if write to the Free Software Franklin Fifth USA !If the compiler accepts long Fortran it is better to use that and build all the preprocessor definitions in one line In !this the debuggers will provide the right line numbers !If the compiler accepts line number then CARDINAL and ACARDINAL !will put them just a new line or a ampersand plus a new line !These macros should be used in macros that span several lines They should by !put immedialty before a line where a compilation error might occur and at the !end of the macro !Note that the cardinal and newline words are substituted by the program !preprocess pl by the ampersand and by a real new line just before compilation !The assertions are ignored if the code is compiled in not debug when !prints out the assertion string
Definition: global.h:46