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