Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
grabpage.cpp File Reference
#include "nsIStreamListener.h"
#include "nsIInputStream.h"
#include "nsIURL.h"
#include "nsNetCID.h"
#include "nsCOMPtr.h"
#include "nsIIOService.h"
#include "nsIChannel.h"
#include "nsILocalFile.h"
#include "nsIEventQueueService.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsCRT.h"
#include "prprf.h"

Go to the source code of this file.

Classes

class  StreamToFile
class  PageGrabber

Functions

static NS_DEFINE_CID (kIOServiceCID, NS_IOSERVICE_CID)
static NS_DEFINE_CID (kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID)
int main (int argc, char **argv)
 The Xalan testcases app.

Variables

static nsIEventQueuegEventQ = nsnull

Function Documentation

int main ( int  argc,
char **  argv 
)

The Xalan testcases app.

Definition at line 287 of file grabpage.cpp.

{
  nsString url_address;

  if (argc != 3) {
    fprintf(stderr, "Usage: grabpage url directory\n");
    return -1;
  }
  PageGrabber* grabber = new PageGrabber();
  if(grabber) {
    nsCOMPtr <nsILocalFile> directory(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID));;
    if (NS_FAILED(directory->InitWithNativePath(nsDependentCString(argv[2])))) {
      fprintf(stderr, "InitWithNativePath failed\n");
      return -2;
    }
    grabber->Init(directory);
    if (NS_OK != grabber->Grab(nsDependentCString(argv[1]))) {
      return -1;
    }
  }
  return 0;
}

Here is the call graph for this function:

static NS_DEFINE_CID ( kIOServiceCID  ,
NS_IOSERVICE_CID   
) [static]

Variable Documentation

Definition at line 50 of file grabpage.cpp.