Nemiver  0.3
nmv-address.h
Go to the documentation of this file.
1 //Author: Dodji Seketeli
2 /*
3  *This file is part of the Nemiver project
4  *
5  *Nemiver is free software; you can redistribute
6  *it and/or modify it under the terms of
7  *the GNU General Public License as published by the
8  *Free Software Foundation; either version 2,
9  *or (at your option) any later version.
10  *
11  *Nemiver is distributed in the hope that it will
12  *be useful, but WITHOUT ANY WARRANTY;
13  *without even the implied warranty of
14  *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *See the GNU General Public License for more details.
16  *
17  *You should have received a copy of the
18  *GNU General Public License along with Nemiver;
19  *see the file COPYING.
20  *If not, write to the Free Software Foundation,
21  *Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22  *
23  *See COPYRIGHT file copyright information.
24  */
25 #ifndef __NMV_ADDRESS_H__
26 #define __NMV_ADDRESS_H__
27 #include <string>
28 #include "nmv-namespace.h"
29 #include "nmv-api-macros.h"
30 
31 NEMIVER_BEGIN_NAMESPACE (nemiver)
32 NEMIVER_BEGIN_NAMESPACE (common)
33 
35 {
36  std::string m_addr;
37 
38 public:
39  Address ();
40  explicit Address (const std::string &a_addr);
41  Address (const Address &);
42  bool empty () const;
43  const std::string& to_string () const;
44  operator size_t () const;
45  size_t size () const;
46  size_t string_size () const;
47  bool operator< (const Address&) const;
48  bool operator<= (const Address&) const;
49  bool operator> (const Address&) const;
50  bool operator>= (const Address&) const;
51  bool operator== (const Address&) const;
52  bool operator== (const std::string &) const;
53  bool operator== (size_t) const;
54  Address& operator= (const std::string &);
55  const char& operator[] (size_t) const;
56  void clear ();
57 };// end class Address
58 
59 template<class Stream>
60 Stream&
61 operator<< (Stream &a_os, const Address &a)
62 {
63  a_os << a.to_string ();
64  return a_os;
65 }
66 
67 NEMIVER_END_NAMESPACE (common)
68 NEMIVER_END_NAMESPACE (nemiver)
69 
70 #endif // __NMV_ADDRESS_H__
nemiver::common::operator<<
Stream & operator<<(Stream &a_os, const Address &a)
Definition: nmv-address.h:61
nemiver
Definition: nmv-address.h:31
NEMIVER_API
#define NEMIVER_API
Definition: nmv-api-macros.h:53
nmv-api-macros.h
nemiver::common::Address::to_string
const std::string & to_string() const
nemiver::common::Address
Definition: nmv-address.h:34
nmv-namespace.h
common
Definition: nmv-proc-list-dialog.h:32