basic implementation of Unix Domain Sockets, for now Datagram only. docs mostly missing.
[senf.git] / Socket / Protocols / UN / UNAddress.hh
1 // $Id$
2 //
3 // Copyright (C) 2007 
4 //
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.
9 //
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.
14 //
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.
19
20 /** \file
21     \brief UNAddress public header */
22
23 #ifndef HH_UNAddress_
24 #define HH_UNAddress_ 1
25
26 // Custom includes
27 #include <string>
28 #include <boost/operators.hpp>
29 #include <boost/filesystem/path.hpp>
30 #include "../../../Utils/SafeBool.hh"
31
32 //#include "UNAddress.mpp"
33 ///////////////////////////////hh.p////////////////////////////////////////
34 namespace senf {
35     class UNAddress 
36         : public boost::filesystem::path,
37           public ComparableSafeBool<UNAddress>
38     {   
39     public: 
40         UNAddress(); 
41         explicit UNAddress(boost::filesystem::path);
42         static UNAddress fromString(std::string & s);
43         static UNAddress fromPath(boost::filesystem::path & p);
44         static std::string pathString();
45         struct AddressException : public std::exception {};
46     private:
47         static boost::filesystem::path path;
48     };
49 const std::ostream & operator<<(std::ostream & os, UNAddress const & addr);
50
51 }
52
53 ///////////////////////////////hh.e////////////////////////////////////////
54 //#include "UNAddress.cci"
55 //#include "UNAddress.ct"
56 //#include "UNAddress.cti"
57 #endif
58
59 \f
60 // Local Variables:
61 // mode: c++
62 // fill-column: 100
63 // comment-column: 40
64 // c-file-style: "senf"
65 // indent-tabs-mode: nil
66 // ispell-local-dictionary: "american"
67 // compile-command: "scons -u test"
68 // End: