Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsFileView.cpp File Reference
#include "nsIFileView.h"
#include "nsITreeView.h"
#include "nsIGenericFactory.h"
#include "nsITreeSelection.h"
#include "nsITreeColumns.h"
#include "nsITreeBoxObject.h"
#include "nsILocalFile.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsCRT.h"
#include "prmem.h"
#include "nsPrintfCString.h"
#include "nsVoidArray.h"
#include "nsIDateTimeFormat.h"
#include "nsDateTimeFormatCID.h"
#include "nsQuickSort.h"
#include "nsIAtom.h"
#include "nsIAutoCompleteResult.h"
#include "nsIAutoCompleteSearch.h"
#include "nsISimpleEnumerator.h"
#include "nsAutoPtr.h"
#include "nsArray.h"
#include "nsWildCard.h"

Go to the source code of this file.

Classes

class  nsFileResult
class  nsFileComplete
class  nsFileView

Defines

#define NS_FILECOMPLETE_CID
#define NS_FILECOMPLETE_CONTRACTID   "@mozilla.org/autocomplete/search;1?name=file"
#define NS_FILEVIEW_CID

Functions

static NS_DEFINE_CID (kDateTimeFormatCID, NS_DATETIMEFORMAT_CID)
 SortNameCallback (const void *aElement1, const void *aElement2, void *aContext)
 SortSizeCallback (const void *aElement1, const void *aElement2, void *aContext)
 SortDateCallback (const void *aElement1, const void *aElement2, void *aContext)

Variables

static const nsModuleComponentInfo components []

Define Documentation

Value:
{ 0xcb60980e, 0x18a5, 0x4a77, \
                            { 0x91, 0x10, 0x81, 0x46, 0x61, 0x4c, 0xa7, 0xf0 } }

Definition at line 64 of file nsFileView.cpp.

#define NS_FILECOMPLETE_CONTRACTID   "@mozilla.org/autocomplete/search;1?name=file"

Definition at line 66 of file nsFileView.cpp.

Value:
{ 0xa5570462, 0x1dd1, 0x11b2, \
                         { 0x9d, 0x19, 0xdf, 0x30, 0xa2, 0x7f, 0xbd, 0xc4 } }

Definition at line 213 of file nsFileView.cpp.


Function Documentation

static NS_DEFINE_CID ( kDateTimeFormatCID  ,
NS_DATETIMEFORMAT_CID   
) [static]
SortDateCallback ( const void aElement1,
const void aElement2,
void aContext 
)

Definition at line 897 of file nsFileView.cpp.

{
  nsIFile* file1 = *NS_STATIC_CAST(nsIFile* const *, aElement1);
  nsIFile* file2 = *NS_STATIC_CAST(nsIFile* const *, aElement2);

  PRInt64 time1, time2;
  file1->GetLastModifiedTime(&time1);
  file2->GetLastModifiedTime(&time2);

  if (LL_EQ(time1, time2))
    return 0;

  return (LL_CMP(time1, <, time2) ? -1 : 1);
}

Here is the caller graph for this function:

SortNameCallback ( const void aElement1,
const void aElement2,
void aContext 
)

Definition at line 868 of file nsFileView.cpp.

{
  nsIFile* file1 = *NS_STATIC_CAST(nsIFile* const *, aElement1);
  nsIFile* file2 = *NS_STATIC_CAST(nsIFile* const *, aElement2);
  
  nsAutoString leafName1, leafName2;
  file1->GetLeafName(leafName1);
  file2->GetLeafName(leafName2);

  return Compare(leafName1, leafName2);
}

Here is the call graph for this function:

Here is the caller graph for this function:

SortSizeCallback ( const void aElement1,
const void aElement2,
void aContext 
)

Definition at line 881 of file nsFileView.cpp.

{
  nsIFile* file1 = *NS_STATIC_CAST(nsIFile* const *, aElement1);
  nsIFile* file2 = *NS_STATIC_CAST(nsIFile* const *, aElement2);

  PRInt64 size1, size2;
  file1->GetFileSize(&size1);
  file2->GetFileSize(&size2);

  if (LL_EQ(size1, size2))
    return 0;

  return (LL_CMP(size1, <, size2) ? -1 : 1);
}

Here is the caller graph for this function:


Variable Documentation

Initial value:
{
  { "nsFileComplete", NS_FILECOMPLETE_CID,
    NS_FILECOMPLETE_CONTRACTID, nsFileCompleteConstructor },
  { "nsFileView", NS_FILEVIEW_CID,
    NS_FILEVIEW_CONTRACTID, nsFileViewConstructor }
}

Definition at line 262 of file nsFileView.cpp.