E-MailRelay

gbasicaddress.h
Go to the documentation of this file.
1//
2// Copyright (C) 2001-2024 Graeme Walker <graeme_walker@users.sourceforge.net>
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16// ===
17///
18/// \file gbasicaddress.h
19///
20
21#ifndef G_BASIC_ADDRESS_H
22#define G_BASIC_ADDRESS_H
23
24#include "gdef.h"
25
26 namespace G
27{
28 class BasicAddress ;
29}
30
31//| \class G::BasicAddress
32/// A structure that holds a network address as a string with no
33/// dependency on any low-level network library.
34/// \see GNet::Address
35///
36 class G::BasicAddress
37{
38 public:
39 explicit BasicAddress( const std::string & s = {} ) ;
40 ///< Constructor.
41
42 std::string displayString() const ;
43 ///< Returns a printable string that represents the transport
44 ///< address.
45
46 private:
47 std::string m_display_string ;
48} ;
49
50 inline
51 G::BasicAddress::BasicAddress( const std::string & s ) :
52 m_display_string(s)
53{
54}
55
56 inline
57std::string G::BasicAddress::displayString() const
58{
59 return m_display_string ;
60}
61
62#endif
G::BasicAddress
A structure that holds a network address as a string with no dependency on any low-level network libr...
Definition: gbasicaddress.h:37
G::BasicAddress::BasicAddress
BasicAddress(const std::string &s={})
Constructor.
Definition: gbasicaddress.h:51
G::BasicAddress::displayString
std::string displayString() const
Returns a printable string that represents the transport address.
Definition: gbasicaddress.h:57
G
Low-level classes.
Definition: garg.h:36