Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: net/base/ip_endpoint.h

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_BASE_IP_ENDPOINT_H_ 5 #ifndef NET_BASE_IP_ENDPOINT_H_
6 #define NET_BASE_IP_ENDPOINT_H_ 6 #define NET_BASE_IP_ENDPOINT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 25 matching lines...) Expand all
36 // Returns the sockaddr family of the address, AF_INET or AF_INET6. 36 // Returns the sockaddr family of the address, AF_INET or AF_INET6.
37 int GetSockAddrFamily() const; 37 int GetSockAddrFamily() const;
38 38
39 // Convert to a provided sockaddr struct. 39 // Convert to a provided sockaddr struct.
40 // |address| is the sockaddr to copy into. Should be at least 40 // |address| is the sockaddr to copy into. Should be at least
41 // sizeof(struct sockaddr_storage) bytes. 41 // sizeof(struct sockaddr_storage) bytes.
42 // |address_length| is an input/output parameter. On input, it is the 42 // |address_length| is an input/output parameter. On input, it is the
43 // size of data in |address| available. On output, it is the size of 43 // size of data in |address| available. On output, it is the size of
44 // the address that was copied into |address|. 44 // the address that was copied into |address|.
45 // Returns true on success, false on failure. 45 // Returns true on success, false on failure.
46 bool ToSockAddr(struct sockaddr* address, socklen_t* address_length) const 46 bool ToSockAddr(struct sockaddr* address,
47 WARN_UNUSED_RESULT; 47 socklen_t* address_length) const WARN_UNUSED_RESULT;
48 48
49 // Convert from a sockaddr struct. 49 // Convert from a sockaddr struct.
50 // |address| is the address. 50 // |address| is the address.
51 // |address_length| is the length of |address|. 51 // |address_length| is the length of |address|.
52 // Returns true on success, false on failure. 52 // Returns true on success, false on failure.
53 bool FromSockAddr(const struct sockaddr* address, socklen_t address_length) 53 bool FromSockAddr(const struct sockaddr* address,
54 WARN_UNUSED_RESULT; 54 socklen_t address_length) WARN_UNUSED_RESULT;
55 55
56 // Returns value as a string (e.g. "127.0.0.1:80"). Returns empty 56 // Returns value as a string (e.g. "127.0.0.1:80"). Returns empty
57 // string if the address is invalid, and cannot not be converted to a 57 // string if the address is invalid, and cannot not be converted to a
58 // string. 58 // string.
59 std::string ToString() const; 59 std::string ToString() const;
60 60
61 // As above, but without port. 61 // As above, but without port.
62 std::string ToStringWithoutPort() const; 62 std::string ToStringWithoutPort() const;
63 63
64 bool operator<(const IPEndPoint& that) const; 64 bool operator<(const IPEndPoint& that) const;
65 bool operator==(const IPEndPoint& that) const; 65 bool operator==(const IPEndPoint& that) const;
66 66
67 private: 67 private:
68 IPAddressNumber address_; 68 IPAddressNumber address_;
69 int port_; 69 int port_;
70 }; 70 };
71 71
72 } // namespace net 72 } // namespace net
73 73
74 #endif // NET_BASE_IP_ENDPOINT_H_ 74 #endif // NET_BASE_IP_ENDPOINT_H_
OLDNEW
« no previous file with comments | « net/base/iovec.h ('k') | net/base/ip_endpoint.cc » ('j') | net/base/mime_sniffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698