removed some errors, added basic unit tests
[senf.git] / Socket / Protocols / UN / UNAddress.cc
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 non-inline non-template implementation */
22
23 #include "UNAddress.hh"
24 //#include "UNAddress.ih"
25
26 // Custom includes
27
28 //#include "UNAddress.mpp"
29 #define prefix_
30 ///////////////////////////////cc.p////////////////////////////////////////
31
32 prefix_ senf::UNAddress::UNAddress()
33     //:path("")
34 {
35     path = boost::filesystem::path("");
36 }
37
38 prefix_ senf::UNAddress::UNAddress(boost::filesystem::path p)
39 {
40     path = p; 
41 }
42
43
44 prefix_ senf::UNAddress::UNAddress senf::UNAddress::fromString(std::string &  s)
45 {
46     return senf::UNAddress::UNAddress(boost::filesystem::path(s));
47 }
48
49 prefix_ senf::UNAddress::UNAddress senf::UNAddress::fromPath(boost::filesystem::path & p){
50     return senf::UNAddress::UNAddress(p);
51 }
52
53 prefix_  std::string senf::UNAddress::pathString()
54     const
55 {
56     return  path.string();
57 }
58
59 prefix_ senf::UNAddress::UNAddress senf::UNAddress::clone()
60 {
61     senf::UNAddress::UNAddress local_addr = senf::UNAddress::UNAddress(pathString());
62     return  local_addr;
63 }
64
65 prefix_ std::ostream & senf::operator<<(std::ostream & os, UNAddress const & addr)
66 {
67     os << addr.pathString();
68     return os;
69 }
70
71 ///////////////////////////////cc.e////////////////////////////////////////
72 #undef prefix_
73 //#include "UNAddress.mpp"
74
75 \f
76 // Local Variables:
77 // mode: c++
78 // fill-column: 100
79 // comment-column: 40
80 // c-file-style: "senf"
81 // indent-tabs-mode: nil
82 // ispell-local-dictionary: "american"
83 // compile-command: "scons -u test"
84 // End: