1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef __NSDIRINDEX_H_
7 #define __NSDIRINDEX_H_
11 #include "nsIDirIndexListener.h"
12 #include "mozilla/RefPtr.h"
15 class nsITextToSubURI
;
17 /* CID: {a0d6ad32-1dd1-11b2-aa55-a40187b54036} */
19 class nsDirIndexParser
: public nsIDirIndexParser
{
21 virtual ~nsDirIndexParser() = default;
23 nsDirIndexParser() = default;
28 NS_DECL_NSISTREAMLISTENER
29 NS_DECL_NSIREQUESTOBSERVER
30 NS_DECL_NSIDIRINDEXPARSER
32 static already_AddRefed
<nsIDirIndexParser
> CreateInstance() {
33 RefPtr
<nsDirIndexParser
> parser
= new nsDirIndexParser();
35 return parser
.forget();
39 FIELD_UNKNOWN
= 0, // MUST be 0
47 nsCOMPtr
<nsIDirIndexListener
> mListener
;
50 int32_t mLineStart
{0};
53 nsresult
ProcessData(nsIRequest
* aRequest
);
54 void ParseFormat(const char* aFormatStr
);
55 void ParseData(nsIDirIndex
* aIdx
, char* aDataStr
, int32_t lineLen
);
62 static Field gFieldTable
[];