5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the
17 // Free Software Foundation, Inc.,
18 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 \brief UNAddress public header */
24 #define HH_UNAddress_ 1
28 #include <boost/operators.hpp>
29 #include <boost/filesystem/path.hpp>
30 #include "../../../Utils/SafeBool.hh"
32 //#include "UNAddress.mpp"
33 ///////////////////////////////hh.p////////////////////////////////////////
35 /** \brief Unix domain address
37 UNAddress represents a simple unix domain address which is given by a path to a socket.
38 It is modelled as a boost::filesystem::path.
43 : public boost::filesystem::path,
44 public ComparableSafeBool<UNAddress>
47 UNAddress(); ///< Construct an empty address
48 explicit UNAddress(boost::filesystem::path);///< Construct an address constant from given path
49 static UNAddress fromString(std::string & s); ///< Convert string to address by interpreting the string as path
50 static UNAddress fromPath(boost::filesystem::path & p);///< Convert path to address
51 UNAddress clone(); ///< Clone object
52 std::string pathString() const; ///< Return the path of the address as string
54 /** \brief Base-class for UNAddress exceptions */
55 struct AddressException : public std::exception {};
58 boost::filesystem::path path;
61 std::ostream & operator<<(std::ostream & os, UNAddress const & addr);
64 ///////////////////////////////hh.e////////////////////////////////////////
65 //#include "UNAddress.cci"
66 //#include "UNAddress.ct"
67 //#include "UNAddress.cti"
75 // c-file-style: "senf"
76 // indent-tabs-mode: nil
77 // ispell-local-dictionary: "american"
78 // compile-command: "scons -u test"