ObjFW
OFHTTPCookie.h
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
3  * Jonathan Schleifer <js@heap.zone>
4  *
5  * All rights reserved.
6  *
7  * This file is part of ObjFW. It may be distributed under the terms of the
8  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
9  * the packaging of this file.
10  *
11  * Alternatively, it may be distributed under the terms of the GNU General
12  * Public License, either version 2 or 3, which can be found in the file
13  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
14  * file.
15  */
16 
17 #import "OFObject.h"
18 #import "OFString.h"
19 
20 OF_ASSUME_NONNULL_BEGIN
21 
22 @class OFArray OF_GENERIC(ObjectType);
23 @class OFDate;
24 @class OFDictionary OF_GENERIC(KeyType, ObjectType);
25 @class OFMutableArray OF_GENERIC(ObjectType);
26 @class OFURL;
27 
34 {
35  OFString *_name, *_value, *_domain, *_path;
36  OFDate *_expires;
37  bool _secure, _HTTPOnly;
38  OFMutableArray OF_GENERIC(OFString *) *_extensions;
39 }
40 
44 @property (nonatomic, copy) OFString *name;
45 
49 @property (nonatomic, copy) OFString *value;
50 
54 @property (nonatomic, copy) OFString *domain;
55 
59 @property (nonatomic, copy) OFString *path;
60 
64 @property OF_NULLABLE_PROPERTY (nonatomic, copy) OFDate *expires;
65 
69 @property (nonatomic, getter=isSecure) bool secure;
70 
74 @property (nonatomic, getter=isHTTPOnly) bool HTTPOnly;
75 
79 @property (readonly, nonatomic)
80  OFMutableArray OF_GENERIC(OFString *) *extensions;
81 
90 + (OFArray OF_GENERIC(OFHTTPCookie *) *)cookiesWithResponseHeaderFields:
91  (OFDictionary OF_GENERIC(OFString *, OFString *) *)headerFields
92  forURL: (OFURL *)URL;
93 
100 + (OFDictionary *)requestHeaderFieldsWithCookies:
101  (OFArray OF_GENERIC(OFHTTPCookie *) *)cookies;
102 
111 + (instancetype)cookieWithName: (OFString *)name
112  value: (OFString *)value
113  domain: (OFString *)domain;
114 
115 - init OF_UNAVAILABLE;
116 
126 - initWithName: (OFString *)name
127  value: (OFString *)value
128  domain: (OFString *)domain OF_DESIGNATED_INITIALIZER;
129 @end
130 
131 OF_ASSUME_NONNULL_END
id copy()
Returns the class.
Definition: OFObject.m:1133
A class for handling strings.
Definition: OFString.h:114
A class for parsing URLs and accessing parts of it.
Definition: OFURL.h:29
id init()
Initializes an already allocated object.
Definition: OFObject.m:488
A protocol for the creation of copies.
Definition: OFObject.h:912
An abstract class for storing objects in a dictionary.
Definition: OFDictionary.h:54
The root class for all other classes inside ObjFW.
Definition: OFObject.h:379
A class for storing, accessing and comparing dates.
Definition: OFDate.h:30
An abstract class for storing objects in an array.
Definition: OFArray.h:89
An abstract class for storing, adding and removing objects in an array.
Definition: OFMutableArray.h:40