ObjFW
Loading...
Searching...
No Matches
OFHTTPCookie.h
1/*
2 * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3 *
4 * All rights reserved.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License version 3.0 only,
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * version 3.0 for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * version 3.0 along with this program. If not, see
17 * <https://www.gnu.org/licenses/>.
18 */
19
20#import "OFObject.h"
21#import "OFString.h"
22
23OF_ASSUME_NONNULL_BEGIN
24
25@class OFArray OF_GENERIC(ObjectType);
26@class OFDate;
27@class OFDictionary OF_GENERIC(KeyType, ObjectType);
28@class OFIRI;
29@class OFMutableArray OF_GENERIC(ObjectType);
30
36OF_SUBCLASSING_RESTRICTED
38{
39 OFString *_name, *_value, *_domain, *_path;
40 OFDate *_Nullable _expires;
41 bool _secure, _HTTPOnly;
42 OFMutableArray OF_GENERIC(OFString *) *_extensions;
43}
44
48@property (copy, nonatomic) OFString *name;
53@property (copy, nonatomic) OFString *value;
58@property (copy, nonatomic) OFString *domain;
63@property (copy, nonatomic) OFString *path;
68@property OF_NULLABLE_PROPERTY (copy, nonatomic) OFDate *expires;
73@property (nonatomic, getter=isSecure) bool secure;
78@property (nonatomic, getter=isHTTPOnly) bool HTTPOnly;
83@property (readonly, nonatomic)
84 OFMutableArray OF_GENERIC(OFString *) *extensions;
96+ (OFArray OF_GENERIC(OFHTTPCookie *) *)cookiesWithResponseHeaderFields:
97 (OFDictionary OF_GENERIC(OFString *, OFString *) *)headerFields
98 forIRI: (OFIRI *)IRI;
99
106+ (OFDictionary *)requestHeaderFieldsWithCookies:
107 (OFArray OF_GENERIC(OFHTTPCookie *) *)cookies;
108
117+ (instancetype)cookieWithName: (OFString *)name
118 value: (OFString *)value
119 domain: (OFString *)domain;
120
121- (instancetype)init OF_UNAVAILABLE;
122
132- (instancetype)initWithName: (OFString *)name
133 value: (OFString *)value
134 domain: (OFString *)domain OF_DESIGNATED_INITIALIZER;
135@end
136
137OF_ASSUME_NONNULL_END
An abstract class for storing objects in an array.
Definition OFArray.h:109
A class for storing, accessing and comparing dates.
Definition OFDate.h:34
An abstract class for storing objects in a dictionary.
Definition OFDictionary.h:84
A class for storing and manipulating HTTP cookies.
Definition OFHTTPCookie.h:39
A class for representing IRIs, URIs, URLs and URNs, for parsing them as well as accessing parts of th...
Definition OFIRI.h:41
An abstract class for storing, adding and removing objects in an array.
Definition OFMutableArray.h:48
The root class for all other classes inside ObjFW.
Definition OFObject.h:692
A class for handling strings.
Definition OFString.h:143
A protocol for the creation of copies.
Definition OFObject.h:1350