1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3
* The contents of this file are subject to the Mozilla Public
4
* License Version 1.1 (the "License"); you may not use this file
5
* except in compliance with the License. You may obtain a copy of
6
* the License at http://www.mozilla.org/MPL/
8
* Software distributed under the License is distributed on an "AS
9
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10
* implied. See the License for the specific language governing
11
* rights and limitations under the License.
13
* The Original Code is nsCacheMetaData.h, released February 22, 2001.
15
* The Initial Developer of the Original Code is Netscape Communications
16
* Corporation. Portions created by Netscape are
17
* Copyright (C) 2001 Netscape Communications Corporation. All
21
* Gordon Sheridan <gordon@netscape.com>
24
#ifndef _nsCacheMetaData_h_
25
#define _nsCacheMetaData_h_
32
class nsICacheMetaDataVisitor;
34
class nsCacheMetaData {
37
~nsCacheMetaData() { Clear(); }
40
PRBool IsEmpty() { return (mData == nsnull); }
42
const char * GetElement(const char * key);
44
nsresult SetElement(const char * key,
47
PRUint32 Size(void) { return mMetaSize; }
49
nsresult FlattenMetaData(char * buffer, PRUint32 bufSize);
51
nsresult UnflattenMetaData(char * buffer, PRUint32 bufSize);
53
nsresult VisitElements(nsICacheMetaDataVisitor * visitor);
59
struct MetaElement * mNext;
60
nsCOMPtr<nsIAtom> mKey;
61
char mValue[1]; // actually, bigger than 1
63
// MetaElement and mValue are allocated together via:
64
void *operator new(size_t size,
66
PRUint32 valueSize) CPP_THROW_NEW;
73
#endif // _nsCacheMetaData_h