2 * Copyright 2010 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 #ifndef _B_HTTP_HEADERS_H_
6 #define _B_HTTP_HEADERS_H_
17 BHttpHeader(const char* string
);
18 BHttpHeader(const char* name
,
20 BHttpHeader(const BHttpHeader
& copy
);
22 // Header data modification
23 void SetName(const char* name
);
24 void SetValue(const char* value
);
25 bool SetHeader(const char* string
);
28 const char* Name() const;
29 const char* Value() const;
30 const char* Header() const;
33 bool NameIs(const char* name
) const;
36 BHttpHeader
& operator=(const BHttpHeader
& other
);
42 mutable BString fRawHeader
;
43 mutable bool fRawHeaderValid
;
50 BHttpHeaders(const BHttpHeaders
& copy
);
54 const char* HeaderValue(const char* name
) const;
55 BHttpHeader
& HeaderAt(int32 index
) const;
58 int32
CountHeaders() const;
61 int32
HasHeader(const char* name
) const;
63 // Header add or replacement
64 bool AddHeader(const char* line
);
65 bool AddHeader(const char* name
,
67 bool AddHeader(const char* name
,
71 void PopulateFromArchive(BMessage
*);
72 void Archive(BMessage
*) const;
77 // Overloaded operators
78 BHttpHeaders
& operator=(const BHttpHeaders
& other
);
79 BHttpHeader
& operator[](int32 index
) const;
80 const char* operator[](const char* name
) const;
84 bool _AddOrDeleteHeader(BHttpHeader
* header
);
90 #endif // _B_HTTP_HEADERS_H_