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 static std::string pathString(); ///< Return the path of the address as string
53 /** \brief Base-class for UNAddress exceptions */
54 struct AddressException : public std::exception {};
57 static boost::filesystem::path path;
59 const std::ostream & operator<<(std::ostream & os, UNAddress const & addr);
63 ///////////////////////////////hh.e////////////////////////////////////////
64 //#include "UNAddress.cci"
65 //#include "UNAddress.ct"
66 //#include "UNAddress.cti"
74 // c-file-style: "senf"
75 // indent-tabs-mode: nil
76 // ispell-local-dictionary: "american"
77 // compile-command: "scons -u test"