STIR 6.4.0
FilePath.inl
Go to the documentation of this file.
1/*
2 Copyright (C) 2018, University of Hull
3
4 This file is part of STIR.
5 SPDX-License-Identifier: Apache-2.0
6
7 See STIR/LICENSE.txt for details
8*/
9
18START_NAMESPACE_STIR
19
20inline bool
21FilePath::operator==(const FilePath& other)
22{
23 if (this->my_string == other.my_string)
24 return true;
25 else
26 return false;
27}
28
29inline bool
30FilePath::operator==(const std::string& other)
31{
32 if (this->my_string == other)
33 return true;
34 else
35 return false;
36}
37
38inline void
39FilePath::operator=(const FilePath& other)
40{
41 this->my_string = other.my_string;
42 this->separator = other.separator;
43}
44
46inline void
47FilePath::operator=(const std::string& other)
48{
49 this->my_string = other;
50 this->initSeparator();
51}
52
53inline void
54FilePath::initSeparator()
55{
56#if defined(__OS_VAX__)
57 separator = ":";
58#elif defined(__OS_WIN__)
59 separator = "\\";
60#elif defined(__OS_MAC__)
61 separator = ":";
62#else // defined(__OS_UNIX__)
63 separator = "/";
64#endif
65}
66
67inline std::string
68FilePath::get_string() const
69{
70 return my_string;
71}
72
73END_NAMESPACE_STIR
std::string my_string
This is the string holding the data.
Definition FilePath.h:143