netwerk/streamconv/converters/nsDirIndexParser.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     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_
     9 #include "nsString.h"
    10 #include "nsCOMPtr.h"
    11 #include "nsIDirIndexListener.h"
    13 class nsIDirIndex;
    14 class nsITextToSubURI;
    16 /* CID: {a0d6ad32-1dd1-11b2-aa55-a40187b54036} */
    18 class nsDirIndexParser : public nsIDirIndexParser {
    19 public:
    20     NS_DECL_ISUPPORTS
    21     NS_DECL_NSISTREAMLISTENER
    22     NS_DECL_NSIREQUESTOBSERVER
    23     NS_DECL_NSIDIRINDEXPARSER
    25     nsDirIndexParser();
    26     virtual ~nsDirIndexParser();
    27     nsresult Init();
    29     enum fieldType {
    30         FIELD_UNKNOWN = 0, // MUST be 0
    31         FIELD_FILENAME,
    32         FIELD_DESCRIPTION,
    33         FIELD_CONTENTLENGTH,
    34         FIELD_LASTMODIFIED,
    35         FIELD_CONTENTTYPE,
    36         FIELD_FILETYPE
    37     };
    39 protected:
    40     nsCOMPtr<nsIDirIndexListener> mListener;
    42     nsCString    mEncoding;
    43     nsCString    mComment;
    44     nsCString    mBuf;
    45     int32_t      mLineStart;
    46     bool         mHasDescription;
    47     int*         mFormat;
    49     nsresult ProcessData(nsIRequest *aRequest, nsISupports *aCtxt);
    50     nsresult ParseFormat(const char* buf);
    51     nsresult ParseData(nsIDirIndex* aIdx, char* aDataStr);
    53     struct Field {
    54         const char *mName;
    55         fieldType mType;
    56     };
    58     static Field gFieldTable[];
    60     static nsrefcnt gRefCntParser;
    61     static nsITextToSubURI* gTextToSubURI;
    62 };
    64 #endif

mercurial