E-MailRelay

gaddresslocal_none.cpp
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 gaddresslocal_none.cpp
19///
20
21#include "gdef.h"
22#include "gaddresslocal.h"
23
24 unsigned short GNet::AddressLocal::af() noexcept
25{
26 return 0 ;
27}
28
29 int GNet::AddressLocal::domain() noexcept
30{
31 return 0 ;
32}
33
34GNet::AddressLocal::AddressLocal( std::nullptr_t ) :
35 m_size(0U)
36{
37 // avoid clang 'unused field' warnings...
38 GDEF_IGNORE_VARIABLE( m_size ) ;
39 GDEF_IGNORE_VARIABLE( m_local ) ;
40}
41
42GNet::AddressLocal::AddressLocal( unsigned int /*port*/ ) :
43 m_size(0U)
44{
45}
46
47GNet::AddressLocal::AddressLocal( unsigned int /*port*/ , int /*loopback_overload*/ ) :
48 m_size(0U)
49{
50}
51
52GNet::AddressLocal::AddressLocal( const sockaddr * /*addr*/ , socklen_t /*len*/ ) :
53 m_size(0U)
54{
55}
56
57GNet::AddressLocal::AddressLocal( std::string_view /*host_part*/ ) :
58 m_size(0U)
59{
60}
61
62 void GNet::AddressLocal::setPort( unsigned int /*port*/ )
63{
64}
65
66 bool GNet::AddressLocal::setZone( std::string_view /*ipv6_zone_name_or_scope_id*/ )
67{
68 return true ;
69}
70
71 void GNet::AddressLocal::setScopeId( unsigned long /*ipv6_scope_id*/ )
72{
73}
74
75std::string GNet::AddressLocal::path() const
76{
77 return std::string() ;
78}
79
80std::string GNet::AddressLocal::displayString( bool /*ipv6_with_scope*/ ) const
81{
82 return path() ;
83}
84
85std::string GNet::AddressLocal::hostPartString() const
86{
87 return displayString() ;
88}
89
90std::string GNet::AddressLocal::queryString() const
91{
92 return std::string() ;
93}
94
95 bool GNet::AddressLocal::validData( const sockaddr * /*addr*/ , socklen_t /*len*/ )
96{
97 return false ;
98}
99
100 bool GNet::AddressLocal::validString( std::string_view /*path*/ , std::string * reason_p )
101{
102 if( reason_p )
103 *reason_p = "not implemented" ;
104 return false ;
105}
106
107 bool GNet::AddressLocal::validStrings( std::string_view /*host_part*/ , std::string_view /*port_part*/ ,
108 std::string * reason_p )
109{
110 return validString( {} , reason_p ) ;
111}
112
113 bool GNet::AddressLocal::validPort( unsigned int /*port*/ )
114{
115 return false ;
116}
117
118 bool GNet::AddressLocal::same( const AddressLocal & /*other*/ , bool /*ipv6_compare_with_scope*/ ) const
119{
120 return false ;
121}
122
123 bool GNet::AddressLocal::sameHostPart( const AddressLocal & /*other*/ ) const
124{
125 return false ;
126}
127
128 unsigned int GNet::AddressLocal::port() const
129{
130 return 0U ;
131}
132
133 unsigned long GNet::AddressLocal::scopeId( unsigned long default_ ) const
134{
135 return default_ ;
136}
137
138 const sockaddr * GNet::AddressLocal::address() const
139{
140 return nullptr ;
141}
142
143sockaddr * GNet::AddressLocal::address()
144{
145 return nullptr ;
146}
147
148socklen_t GNet::AddressLocal::length() const noexcept
149{
150 return 0 ;
151}
152
153 G::StringArray GNet::AddressLocal::wildcards() const
154{
155 return {} ;
156}
157
158 bool GNet::AddressLocal::format( const std::string & )
159{
160 return true ;
161}
162
163 bool GNet::AddressLocal::isLocal( std::string & ) const
164{
165 return false ;
166}
167
168 bool GNet::AddressLocal::isLoopback() const
169{
170 return false ;
171}
172
173 bool GNet::AddressLocal::isLinkLocal() const
174{
175 return false ;
176}
177
178 bool GNet::AddressLocal::isUniqueLocal() const
179{
180 return false ;
181}
182
183 bool GNet::AddressLocal::isMulticast() const
184{
185 return false ;
186}
187
188 bool GNet::AddressLocal::isAny() const
189{
190 return false ;
191}
192
193 unsigned int GNet::AddressLocal::bits() const
194{
195 return 0U ;
196}
197
gaddresslocal.h
G::StringArray
std::vector< std::string > StringArray
A std::vector of std::strings.
Definition: gstringarray.h:30