NetServices: format code using haiku-format
This commit formats all the netservices2 code with the `haiku-format` tool from https://github.com/owenca/haiku-format (commit aa7408e), with the following customizations: * SpaceBeforeRangeBasedForLoopColon is set to false * Braces before a catch block are not wrapped * Most headers, except for ExclusiveBorrow.h, have been manually reformatted to adhere to Haiku's header format (issue #19 in the repository) Change-Id: I693c4515cf26402e48f35d1213ab6d5fcf14bd1e
This commit is contained in:
@@ -18,65 +18,62 @@ namespace Network {
|
||||
|
||||
|
||||
// Standard exceptions
|
||||
class BUnsupportedProtocol : public BError {
|
||||
class BUnsupportedProtocol : public BError
|
||||
{
|
||||
public:
|
||||
BUnsupportedProtocol(const char* origin, BUrl url,
|
||||
BStringList supportedProtocols);
|
||||
BUnsupportedProtocol(BString origin, BUrl url,
|
||||
BStringList supportedProtocols);
|
||||
BUnsupportedProtocol(const char* origin, BUrl url,
|
||||
BStringList supportedProtocols);
|
||||
BUnsupportedProtocol(BString origin, BUrl url,
|
||||
BStringList supportedProtocols);
|
||||
|
||||
virtual const char* Message() const noexcept override;
|
||||
virtual const char* Message() const noexcept override;
|
||||
|
||||
const BUrl& Url() const;
|
||||
const BStringList& SupportedProtocols() const;
|
||||
const BUrl& Url() const;
|
||||
const BStringList& SupportedProtocols() const;
|
||||
|
||||
private:
|
||||
BUrl fUrl;
|
||||
BStringList fSupportedProtocols;
|
||||
BUrl fUrl;
|
||||
BStringList fSupportedProtocols;
|
||||
};
|
||||
|
||||
|
||||
class BInvalidUrl : public BError {
|
||||
class BInvalidUrl : public BError
|
||||
{
|
||||
public:
|
||||
BInvalidUrl(const char* origin, BUrl url);
|
||||
BInvalidUrl(BString origin, BUrl url);
|
||||
BInvalidUrl(const char* origin, BUrl url);
|
||||
BInvalidUrl(BString origin, BUrl url);
|
||||
|
||||
virtual const char* Message() const noexcept override;
|
||||
virtual const char* Message() const noexcept override;
|
||||
|
||||
const BUrl& Url() const;
|
||||
const BUrl& Url() const;
|
||||
|
||||
private:
|
||||
BUrl fUrl;
|
||||
BUrl fUrl;
|
||||
};
|
||||
|
||||
|
||||
class BNetworkRequestError : public BError {
|
||||
class BNetworkRequestError : public BError
|
||||
{
|
||||
public:
|
||||
enum ErrorType {
|
||||
HostnameError,
|
||||
NetworkError,
|
||||
ProtocolError,
|
||||
SystemError,
|
||||
Canceled
|
||||
};
|
||||
enum ErrorType { HostnameError, NetworkError, ProtocolError, SystemError, Canceled };
|
||||
|
||||
BNetworkRequestError(const char* origin, ErrorType type,
|
||||
status_t errorCode, const BString& customMessage = BString());
|
||||
BNetworkRequestError(const char* origin, ErrorType type,
|
||||
const BString& customMessage = BString());
|
||||
BNetworkRequestError(const char* origin, ErrorType type,
|
||||
status_t errorCode, const BString& customMessage = BString());
|
||||
BNetworkRequestError(const char* origin, ErrorType type,
|
||||
const BString& customMessage = BString());
|
||||
|
||||
virtual const char* Message() const noexcept override;
|
||||
virtual BString DebugMessage() const override;
|
||||
virtual const char* Message() const noexcept override;
|
||||
virtual BString DebugMessage() const override;
|
||||
|
||||
ErrorType Type() const noexcept;
|
||||
status_t ErrorCode() const noexcept;
|
||||
ErrorType Type() const noexcept;
|
||||
status_t ErrorCode() const noexcept;
|
||||
|
||||
const char* CustomMessage() const noexcept;
|
||||
const char* CustomMessage() const noexcept;
|
||||
|
||||
private:
|
||||
ErrorType fErrorType;
|
||||
status_t fErrorCode = B_OK;
|
||||
BString fCustomMessage;
|
||||
ErrorType fErrorType;
|
||||
status_t fErrorCode = B_OK;
|
||||
BString fCustomMessage;
|
||||
};
|
||||
|
||||
|
||||
@@ -84,37 +81,33 @@ BString encode_to_base64(const BString& string);
|
||||
|
||||
|
||||
namespace UrlEvent {
|
||||
enum {
|
||||
HostNameResolved = '_NHR',
|
||||
ConnectionOpened = '_NCO',
|
||||
UploadProgress = '_NUP',
|
||||
ResponseStarted = '_NRS',
|
||||
DownloadProgress = '_NDP',
|
||||
BytesWritten = '_NBW',
|
||||
RequestCompleted = '_NRC',
|
||||
DebugMessage = '_NDB'
|
||||
};
|
||||
enum {
|
||||
HostNameResolved = '_NHR',
|
||||
ConnectionOpened = '_NCO',
|
||||
UploadProgress = '_NUP',
|
||||
ResponseStarted = '_NRS',
|
||||
DownloadProgress = '_NDP',
|
||||
BytesWritten = '_NBW',
|
||||
RequestCompleted = '_NRC',
|
||||
DebugMessage = '_NDB'
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
namespace UrlEventData {
|
||||
extern const char* Id;
|
||||
extern const char* HostName;
|
||||
extern const char* NumBytes;
|
||||
extern const char* TotalBytes;
|
||||
extern const char* Success;
|
||||
extern const char* DebugType;
|
||||
extern const char* DebugMessage;
|
||||
extern const char* Id;
|
||||
extern const char* HostName;
|
||||
extern const char* NumBytes;
|
||||
extern const char* TotalBytes;
|
||||
extern const char* Success;
|
||||
extern const char* DebugType;
|
||||
extern const char* DebugMessage;
|
||||
|
||||
enum {
|
||||
DebugInfo = '_DBI',
|
||||
DebugWarning = '_DBW',
|
||||
DebugError = '_DBE'
|
||||
};
|
||||
}
|
||||
enum { DebugInfo = '_DBI', DebugWarning = '_DBW', DebugError = '_DBE' };
|
||||
} // namespace UrlEventData
|
||||
|
||||
}
|
||||
} // namespace Network
|
||||
|
||||
}
|
||||
} // namespace BPrivate
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user