Blame src/HttpDir.h

Packit Service a2489d
/*
Packit Service a2489d
 * lftp - file transfer program
Packit Service a2489d
 *
Packit Service a2489d
 * Copyright (c) 1996-2012 by Alexander V. Lukyanov (lav@yars.free.net)
Packit Service a2489d
 *
Packit Service a2489d
 * This program is free software; you can redistribute it and/or modify
Packit Service a2489d
 * it under the terms of the GNU General Public License as published by
Packit Service a2489d
 * the Free Software Foundation; either version 3 of the License, or
Packit Service a2489d
 * (at your option) any later version.
Packit Service a2489d
 *
Packit Service a2489d
 * This program is distributed in the hope that it will be useful,
Packit Service a2489d
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service a2489d
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service a2489d
 * GNU General Public License for more details.
Packit Service a2489d
 *
Packit Service a2489d
 * You should have received a copy of the GNU General Public License
Packit Service a2489d
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit Service a2489d
 */
Packit Service a2489d
Packit Service a2489d
#ifndef HTTPDIR_H
Packit Service a2489d
#define HTTPDIR_H
Packit Service a2489d
Packit Service a2489d
#include "Http.h"
Packit Service a2489d
#if USE_EXPAT
Packit Service a2489d
# include <expat.h>
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
class HttpListInfo : public GenericParseListInfo
Packit Service a2489d
{
Packit Service a2489d
   FileSet *Parse(const char *buf,int len);
Packit Service a2489d
public:
Packit Service a2489d
   HttpListInfo(Http *session,const char *path)
Packit Service a2489d
      : GenericParseListInfo(session,path)
Packit Service a2489d
      {
Packit Service a2489d
	 get_time_for_dirs=false;
Packit Service a2489d
      }
Packit Service a2489d
   static FileSet *ParseProps(const char *buf,int len,const char *base_dir);
Packit Service a2489d
};
Packit Service a2489d
Packit Service a2489d
class ParsedURL;
Packit Service a2489d
Packit Service a2489d
class HttpDirList : public DirList
Packit Service a2489d
{
Packit Service a2489d
   SMTaskRef<IOBuffer> ubuf;
Packit Service a2489d
   const char *curr;
Packit Service a2489d
   Ref<ParsedURL> curr_url;
Packit Service a2489d
   FileSet all_links;
Packit Service a2489d
   int mode;
Packit Service a2489d
   bool parse_as_html;
Packit Service a2489d
   xstring_c base_href;
Packit Service a2489d
Packit Service a2489d
#if USE_EXPAT
Packit Service a2489d
   XML_Parser xml_p;
Packit Service a2489d
   struct xml_context *xml_ctx;
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
   LsOptions ls_options;
Packit Service a2489d
Packit Service a2489d
   void ParsePropsFormat(const char *b,int len,bool eof);
Packit Service a2489d
Packit Service a2489d
public:
Packit Service a2489d
   HttpDirList(FileAccess *s,ArgV *a);
Packit Service a2489d
   ~HttpDirList();
Packit Service a2489d
   const char *Status();
Packit Service a2489d
   int Do();
Packit Service a2489d
Packit Service a2489d
   void SuspendInternal();
Packit Service a2489d
   void ResumeInternal();
Packit Service a2489d
};
Packit Service a2489d
Packit Service a2489d
#endif//HTTPDIR_H