Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
nsMsgFilterList Class Reference

#include <nsMsgFilterList.h>

Inheritance diagram for nsMsgFilterList:
Inheritance graph
[legend]
Collaboration diagram for nsMsgFilterList:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIMSGFILTERLIST 
nsMsgFilterList ()
virtual ~nsMsgFilterList ()
nsresult Close ()
nsresult LoadTextFilters (nsIOFileStream *aStream)
nsIMsgFilter getFilterAt (in unsigned long filterIndex)
nsIMsgFilter getFilterNamed (in wstring filterName)
void setFilterAt (in unsigned long filterIndex, in nsIMsgFilter filter)
void removeFilter (in nsIMsgFilter filter)
void removeFilterAt (in unsigned long filterIndex)
void moveFilterAt (in unsigned long filterIndex, in nsMsgFilterMotionValue motion)
void moveFilter (in nsIMsgFilter filter, in nsMsgFilterMotionValue motion)
void insertFilterAt (in unsigned long filterIndex, in nsIMsgFilter filter)
nsIMsgFilter createFilter (in wstring name)
void saveToFile (in nsIOFileStream stream)
void parseCondition (in nsIMsgFilter aFilter, in string condition)
void saveToDefaultFile ()
void applyFiltersToHdr (in nsMsgFilterTypeType filterType, in nsIMsgDBHdr msgHdr, in nsIMsgFolder folder, in nsIMsgDatabase db, in string headers, in unsigned long headerSize, in nsIMsgFilterHitNotify listener, in nsIMsgWindow msgWindow, in nsILocalFile aMessageFile)
void writeIntAttr (in nsMsgFilterFileAttribValue attrib, in long value, in nsIOFileStream stream)
void writeStrAttr (in nsMsgFilterFileAttribValue attrib, in string value, in nsIOFileStream stream)
void writeWstrAttr (in nsMsgFilterFileAttribValue attrib, in wstring value, in nsIOFileStream stream)
void writeBoolAttr (in nsMsgFilterFileAttribValue attrib, in boolean value, in nsIOFileStream stream)
boolean matchOrChangeFilterTarget (in string oldUri, in string newUri, in boolean caseInsensitive)
void clearLog ()
void ensureLogFile ()
void flushLogIfNecessary ()

Public Attributes

PRBool m_temporaryList
const nsMsgFilterFileAttribValue attribNone = 0
const nsMsgFilterFileAttribValue attribVersion = 1
const nsMsgFilterFileAttribValue attribLogging = 2
const nsMsgFilterFileAttribValue attribName = 3
const nsMsgFilterFileAttribValue attribEnabled = 4
const nsMsgFilterFileAttribValue attribDescription = 5
const nsMsgFilterFileAttribValue attribType = 6
const nsMsgFilterFileAttribValue attribScriptFile = 7
const nsMsgFilterFileAttribValue attribAction = 8
const nsMsgFilterFileAttribValue attribActionValue = 9
const nsMsgFilterFileAttribValue attribCondition = 10
attribute nsIMsgFolder folder
readonly attribute short version
readonly attribute string arbitraryHeaders
readonly attribute boolean shouldDownloadAllHeaders
readonly attribute unsigned long filterCount
attribute boolean loggingEnabled
attribute nsIFileSpec defaultFile
attribute nsIOutputStream logStream
readonly attribute string logURL

Protected Member Functions

nsresult GetMsgFilterAt (PRUint32 filterIndex, nsMsgFilter **filter)
nsresult ComputeArbitraryHeaders ()
nsresult SaveTextFilters (nsIOFileStream *aStream)
char ReadChar (nsIOFileStream *aStream)
char SkipWhitespace (nsIOFileStream *aStream)
PRBool StrToBool (nsCString &str)
char LoadAttrib (nsMsgFilterFileAttribValue &attrib, nsIOFileStream *aStream)
const char * GetStringForAttrib (nsMsgFilterFileAttribValue attrib)
nsresult LoadValue (nsCString &value, nsIOFileStream *aStream)

Protected Attributes

PRInt16 m_fileVersion
PRPackedBool m_loggingEnabled
PRPackedBool m_startWritingToBuffer
nsCOMPtr< nsIMsgFolderm_folder
nsMsgFilterm_curFilter
const char * m_filterFileName
nsCOMPtr< nsISupportsArraym_filters
nsCString m_arbitraryHeaders
nsCOMPtr< nsIFileSpecm_defaultFile
nsCString m_unparsedFilterBuffer

Private Member Functions

nsresult TruncateLog ()
nsresult GetLogFileSpec (nsIFileSpec **aFileSpec)

Private Attributes

nsCOMPtr< nsIOutputStreamm_logStream

Detailed Description

Definition at line 65 of file nsMsgFilterList.h.


Constructor & Destructor Documentation

Definition at line 68 of file nsMsgFilterList.cpp.

                                 :
    m_fileVersion(0)
{
  // I don't know how we're going to report this error if we failed to create the isupports array...
#ifdef DEBUG
  nsresult rv =
#endif
    NS_NewISupportsArray(getter_AddRefs(m_filters));
  NS_ASSERTION(NS_SUCCEEDED(rv), "Fixme bug 180312: NS_NewISupportsArray() failed");

  m_loggingEnabled = PR_FALSE;
  m_startWritingToBuffer = PR_FALSE; 
  m_temporaryList = PR_FALSE;
  m_curFilter = nsnull;
  m_arbitraryHeaders.SetLength(0);
}

Here is the call graph for this function:

Definition at line 931 of file nsMsgFilterList.cpp.

{
       // filters should be released for free, because only isupports array
       // is holding onto them, right?
//     PRUint32                    filterCount;
//     m_filters->Count(&filterCount);
//     for (PRUint32 i = 0; i < filterCount; i++)
//     {
//            nsIMsgFilter *filter;
//            if (GetFilterAt(i, &filter) == NS_OK)
//                   NS_RELEASE(filter);
//     }
}

Member Function Documentation

void nsIMsgFilterList::applyFiltersToHdr ( in nsMsgFilterTypeType  filterType,
in nsIMsgDBHdr  msgHdr,
in nsIMsgFolder  folder,
in nsIMsgDatabase  db,
in string  headers,
in unsigned long  headerSize,
in nsIMsgFilterHitNotify  listener,
in nsIMsgWindow  msgWindow,
in nsILocalFile  aMessageFile 
) [inherited]

Definition at line 945 of file nsMsgFilterList.cpp.

Definition at line 1163 of file nsMsgFilterList.cpp.

{
  nsresult rv = NS_OK;
  if (m_arbitraryHeaders.IsEmpty())
  {
    PRUint32 numFilters;
    rv = m_filters->Count(&numFilters);
    NS_ENSURE_SUCCESS(rv,rv);
    nsCOMPtr <nsIMsgFilter> filter;
    nsMsgSearchAttribValue attrib;
    nsXPIDLCString arbitraryHeader;
    for (PRUint32 index = 0; index < numFilters; index++)
    {
      filter = do_QueryElementAt(m_filters, index, &rv);
      if (NS_SUCCEEDED(rv) && filter)
      {
        nsCOMPtr <nsISupportsArray> searchTerms;
        PRUint32 numSearchTerms=0;
        filter->GetSearchTerms(getter_AddRefs(searchTerms));
        if (searchTerms)
          searchTerms->Count(&numSearchTerms);
        for (PRUint32 i=0; i< numSearchTerms;i++)
        {
          filter->GetTerm(i, &attrib, nsnull,nsnull,nsnull, getter_Copies(arbitraryHeader));
          if (arbitraryHeader && arbitraryHeader[0])
          {
            if (m_arbitraryHeaders.IsEmpty())
              m_arbitraryHeaders.Assign(arbitraryHeader);
            else if (PL_strncasecmp(m_arbitraryHeaders.get(), arbitraryHeader, arbitraryHeader.Length()))
            {
              m_arbitraryHeaders.Append(" ");
              m_arbitraryHeaders.Append(arbitraryHeader);
            }
          }
        }
      }
    }
  }
  return rv;
}

Here is the call graph for this function:

nsIMsgFilter nsIMsgFilterList::createFilter ( in wstring  name) [inherited]
nsIMsgFilter nsIMsgFilterList::getFilterAt ( in unsigned long  filterIndex) [inherited]
nsIMsgFilter nsIMsgFilterList::getFilterNamed ( in wstring  filterName) [inherited]

Definition at line 176 of file nsMsgFilterList.cpp.

{
  NS_ENSURE_ARG_POINTER(aFileSpec);

  // XXX todo
  // the path to the log file won't change
  // should we cache it?
  nsCOMPtr <nsIMsgFolder> folder;
  nsresult rv = GetFolder(getter_AddRefs(folder));
  NS_ENSURE_SUCCESS(rv,rv);

  nsCOMPtr <nsIMsgIncomingServer> server;
  rv = folder->GetServer(getter_AddRefs(server));
  NS_ENSURE_SUCCESS(rv,rv);

  nsXPIDLCString type;
  rv = server->GetType(getter_Copies(type));
  NS_ENSURE_SUCCESS(rv,rv);

  PRBool isServer = PR_FALSE;
  rv = folder->GetIsServer(&isServer);
  NS_ENSURE_SUCCESS(rv,rv);

  // for news folders (not servers), the filter file is
  // mcom.test.dat
  // where the summary file is 
  // mcom.test.msf
  // since the log is an html file we make it
  // mcom.test.htm
  if (type.Equals("nntp") && !isServer) 
  {
    nsCOMPtr<nsIFileSpec> thisFolder;
    rv = m_folder->GetPath(getter_AddRefs(thisFolder));
    NS_ENSURE_SUCCESS(rv, rv);

    nsCOMPtr <nsIFileSpec> filterLogFile = do_CreateInstance(NS_FILESPEC_CONTRACTID, &rv);
    NS_ENSURE_SUCCESS(rv, rv);
    
    rv = filterLogFile->FromFileSpec(thisFolder);
    NS_ENSURE_SUCCESS(rv, rv);
    
    // NOTE:
    // we don't we need to call NS_MsgHashIfNecessary()
    // it's already been hashed, if necessary
    nsXPIDLCString filterLogName;
    rv = filterLogFile->GetLeafName(getter_Copies(filterLogName));
    NS_ENSURE_SUCCESS(rv,rv);
    
    filterLogName.Append(".htm");
    
    rv = filterLogFile->SetLeafName(filterLogName.get());
    NS_ENSURE_SUCCESS(rv,rv);

    NS_IF_ADDREF(*aFileSpec = filterLogFile);
  }
  else {
    rv = server->GetLocalPath(aFileSpec);
    NS_ENSURE_SUCCESS(rv,rv);
    
    rv = (*aFileSpec)->AppendRelativeUnixPath("filterlog.html");
    NS_ENSURE_SUCCESS(rv,rv);
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgFilterList::GetMsgFilterAt ( PRUint32  filterIndex,
nsMsgFilter **  filter 
) [protected]

Definition at line 955 of file nsMsgFilterList.cpp.

{
       PRUint32                    filterCount;
       m_filters->Count(&filterCount);
       if (! (filterCount >= filterIndex))
              return NS_ERROR_INVALID_ARG;
       if (filter == nsnull)
              return NS_ERROR_NULL_POINTER;
       *filter = (nsMsgFilter *) m_filters->ElementAt(filterIndex);
       return NS_OK;
}

Here is the caller graph for this function:

Definition at line 502 of file nsMsgFilterList.cpp.

{
  for (int tableIndex = 0; tableIndex < (int)(sizeof(FilterFileAttribTable) / sizeof(FilterFileAttribTable[0])); tableIndex++)
  {
    if (attrib == FilterFileAttribTable[tableIndex].attrib)
      return FilterFileAttribTable[tableIndex].attribName;
  }
  return nsnull;
}

Here is the caller graph for this function:

void nsIMsgFilterList::insertFilterAt ( in unsigned long  filterIndex,
in nsIMsgFilter  filter 
) [inherited]
char nsMsgFilterList::LoadAttrib ( nsMsgFilterFileAttribValue attrib,
nsIOFileStream aStream 
) [protected]

Definition at line 475 of file nsMsgFilterList.cpp.

{
  char attribStr[100];
  char curChar;
  attrib = nsIMsgFilterList::attribNone;
  
  curChar = SkipWhitespace(aStream);
  int i;
  for (i = 0; i + 1 < (int)(sizeof(attribStr)); )
  {
    if (curChar == (char) -1 || nsCRT::IsAsciiSpace((PRUnichar)curChar) || curChar == '=')
      break;
    attribStr[i++] = curChar;
    curChar = ReadChar(aStream);
  }
  attribStr[i] = '\0';
  for (int tableIndex = 0; tableIndex < (int)(sizeof(FilterFileAttribTable) / sizeof(FilterFileAttribTable[0])); tableIndex++)
  {
    if (!PL_strcasecmp(attribStr, FilterFileAttribTable[tableIndex].attribName))
    {
      attrib = FilterFileAttribTable[tableIndex].attrib;
      break;
    }
  }
  return curChar;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 557 of file nsMsgFilterList.cpp.

{
  nsresult    err = NS_OK;
  nsMsgFilterFileAttribValue attrib;
  nsCOMPtr<nsIImportService> impSvc;
  nsCOMPtr<nsIMsgRuleAction> currentFilterAction;
  // We'd really like to move lot's of these into the objects that they refer to.
  aStream->seek(PR_SEEK_SET, 0);
  do 
  {
    nsCAutoString    value;
    PRInt32 intToStringResult;
    
    char curChar;
    curChar = LoadAttrib(attrib, aStream);
    if (curChar == (char) -1)  //reached eof
      break;
    err = LoadValue(value, aStream);
    if (err != NS_OK)
      break;
    switch(attrib)
    {
    case nsIMsgFilterList::attribNone:
      m_curFilter->SetUnparseable(PR_TRUE);
      break;
    case nsIMsgFilterList::attribVersion:
      m_fileVersion = value.ToInteger(&intToStringResult, 10);
      if (intToStringResult != 0)
      {
        attrib = nsIMsgFilterList::attribNone;
        NS_ASSERTION(PR_FALSE, "error parsing filter file version");
      }
      if (m_fileVersion == k45Version)
      {
        impSvc = do_GetService(NS_IMPORTSERVICE_CONTRACTID);
        NS_ASSERTION(impSvc, "cannot get importService");
      }
      break;
    case nsIMsgFilterList::attribLogging:
      m_loggingEnabled = StrToBool(value);
      m_unparsedFilterBuffer.Truncate(); //we are going to buffer each filter as we read them, make sure no garbage is there
      m_startWritingToBuffer = PR_TRUE; //filters begin now
      break;
    case nsIMsgFilterList::attribName:  //every filter starts w/ a name
      {
        if (m_curFilter)
        {
          PRInt32 nextFilterStartPos = m_unparsedFilterBuffer.RFind("name");
          nsCAutoString nextFilterPart;
          nextFilterPart = Substring(m_unparsedFilterBuffer, nextFilterStartPos, m_unparsedFilterBuffer.Length());
          m_unparsedFilterBuffer.Truncate(nextFilterStartPos);
          
          PRBool unparseableFilter;
          m_curFilter->GetUnparseable(&unparseableFilter);
          if (unparseableFilter)
          {
            m_curFilter->SetUnparsedBuffer(m_unparsedFilterBuffer.get());
            m_curFilter->SetEnabled(PR_FALSE); //disable the filter because we don't know how to apply it
          }
          m_unparsedFilterBuffer = nextFilterPart;
        }
        nsMsgFilter *filter = new nsMsgFilter;
        if (filter == nsnull)
        {
          err = NS_ERROR_OUT_OF_MEMORY;
          break;
        }
        filter->SetFilterList(NS_STATIC_CAST(nsIMsgFilterList*,this));
        if (m_fileVersion == k45Version && impSvc)
        {
          nsAutoString unicodeStr;
          impSvc->SystemStringToUnicode(value.get(), unicodeStr);
          filter->SetFilterName(unicodeStr.get());
        }
        else
        {  
          PRUnichar *unicodeString =
            nsTextFormatter::smprintf(unicodeFormatter, value.get());
          filter->SetFilterName(unicodeString);
          nsTextFormatter::smprintf_free(unicodeString);
        }
        m_curFilter = filter;
        m_filters->AppendElement(NS_STATIC_CAST(nsISupports*,filter));
      }
      break;
    case nsIMsgFilterList::attribEnabled:
      if (m_curFilter)
        m_curFilter->SetEnabled(StrToBool(value));
      break;
    case nsIMsgFilterList::attribDescription:
      if (m_curFilter)
        m_curFilter->SetFilterDesc(value.get());
      break;
    case nsIMsgFilterList::attribType:
      if (m_curFilter)
        m_curFilter->SetType((nsMsgFilterTypeType) value.ToInteger(&intToStringResult, 10));
      break;
    case nsIMsgFilterList::attribScriptFile:
      if (m_curFilter)
        m_curFilter->SetFilterScript(&value);
      break;
    case nsIMsgFilterList::attribAction:
      if (m_curFilter)
      {
        nsMsgRuleActionType actionType = nsMsgFilter::GetActionForFilingStr(value);
        if (actionType == nsMsgFilterAction::None)
          m_curFilter->SetUnparseable(PR_TRUE);
        else
        {
          err = m_curFilter->CreateAction(getter_AddRefs(currentFilterAction));
          NS_ENSURE_SUCCESS(err, err);
          currentFilterAction->SetType(actionType);
          m_curFilter->AppendAction(currentFilterAction);
        }
      }
      break;
    case nsIMsgFilterList::attribActionValue:
      if (m_curFilter && currentFilterAction)
      {
        nsMsgRuleActionType type;
        currentFilterAction->GetType(&type);
        if (type == nsMsgFilterAction::MoveToFolder ||
              type == nsMsgFilterAction::CopyToFolder)
          err = m_curFilter->ConvertMoveOrCopyToFolderValue(currentFilterAction, value);
        else if (type == nsMsgFilterAction::ChangePriority)
        {
          nsMsgPriorityValue outPriority;
          nsresult res = NS_MsgGetPriorityFromString(value.get(), outPriority);
          if (NS_SUCCEEDED(res))
            currentFilterAction->SetPriority(outPriority);
          else
            NS_ASSERTION(PR_FALSE, "invalid priority in filter file");
        }
        else if (type == nsMsgFilterAction::Label)
        {
          // upgrade label to corresponding tag/keyword
          PRInt32 res;
          PRInt32 labelInt = value.ToInteger(&res, 10);
          if (res == 0)
          {
            nsCAutoString keyword("$label");
            keyword.Append('0' + labelInt);
            currentFilterAction->SetType(nsMsgFilterAction::AddTag);
            currentFilterAction->SetStrValue(keyword.get());
          }
        }
        else if (type == nsMsgFilterAction::JunkScore)
        {
          PRInt32 res;
          PRInt32 junkScore = value.ToInteger(&res, 10);
          if (!res)
            currentFilterAction->SetJunkScore(junkScore);
        }
        else if (type == nsMsgFilterAction::Forward || type == nsMsgFilterAction::Reply
          || type == nsMsgFilterAction::AddTag)
        {
          currentFilterAction->SetStrValue(value.get());
        }
      }
      break;
    case nsIMsgFilterList::attribCondition:
      if (m_curFilter)
      {
        if ( m_fileVersion == k45Version && impSvc)
        {
          nsAutoString unicodeStr;
          impSvc->SystemStringToUnicode(value.get(), unicodeStr);
          char *utf8 = ToNewUTF8String(unicodeStr);
          value.Assign(utf8);
          nsMemory::Free(utf8);
        }
        err = ParseCondition(m_curFilter, value.get());
        if (err == NS_ERROR_INVALID_ARG)
          err = m_curFilter->SetUnparseable(PR_TRUE);
        NS_ENSURE_SUCCESS(err, err);
      }
      break;
    }
  } while (!aStream->eof());
  
  if (m_curFilter)
  {
    PRBool unparseableFilter;
    m_curFilter->GetUnparseable(&unparseableFilter);
    if (unparseableFilter)
    {
      m_curFilter->SetUnparsedBuffer(m_unparsedFilterBuffer.get());
      m_curFilter->SetEnabled(PR_FALSE);  //disable the filter because we don't know how to apply it
    }
  }
  
  return err;
}

Here is the call graph for this function:

nsresult nsMsgFilterList::LoadValue ( nsCString value,
nsIOFileStream aStream 
) [protected]

Definition at line 512 of file nsMsgFilterList.cpp.

{
  nsCAutoString      valueStr;
  char curChar;
  value = "";
  curChar = SkipWhitespace(aStream);
  if (curChar != '"')
  {
    NS_ASSERTION(PR_FALSE, "expecting quote as start of value");
    return NS_MSG_FILTER_PARSE_ERROR;
  }
  curChar = ReadChar(aStream);
  do
  {
    if (curChar == '\\')
    {
      char nextChar = ReadChar(aStream);
      if (nextChar == '"')
        curChar = '"';
      else if (nextChar == '\\')   // replace "\\" with "\"
      {
        valueStr += curChar;
        curChar = ReadChar(aStream);
      }
      else
      {
        valueStr += curChar;
        curChar = nextChar;
      }
    }
    else
    {
      if (curChar == (char) -1 || curChar == '"' || curChar == '\n' || curChar == '\r')
      {
        value += valueStr;
        break;
      }
    }
    valueStr += curChar;
    curChar = ReadChar(aStream);
  }
  while (!aStream->eof());
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

boolean nsIMsgFilterList::matchOrChangeFilterTarget ( in string  oldUri,
in string  newUri,
in boolean  caseInsensitive 
) [inherited]
void nsIMsgFilterList::moveFilterAt ( in unsigned long  filterIndex,
in nsMsgFilterMotionValue  motion 
) [inherited]
void nsIMsgFilterList::parseCondition ( in nsIMsgFilter  aFilter,
in string  condition 
) [inherited]
char nsMsgFilterList::ReadChar ( nsIOFileStream aStream) [protected]

Definition at line 446 of file nsMsgFilterList.cpp.

{
  char newChar;
  *aStream >> newChar;
  if (aStream->eof())
    return -1;
  else
  {
    if (m_startWritingToBuffer)
      m_unparsedFilterBuffer.Append(newChar);
    return newChar;
  }
}

Here is the caller graph for this function:

void nsIMsgFilterList::removeFilterAt ( in unsigned long  filterIndex) [inherited]

Definition at line 896 of file nsMsgFilterList.cpp.

{
       nsresult      err = NS_OK;
       const char *attribStr;
       PRUint32                    filterCount;
       m_filters->Count(&filterCount);

       attribStr = GetStringForAttrib(nsIMsgFilterList::attribVersion);
       err = WriteIntAttr(nsIMsgFilterList::attribVersion, kFileVersion, aStream);
       err = WriteBoolAttr(nsIMsgFilterList::attribLogging, m_loggingEnabled, aStream);
       for (PRUint32 i = 0; i < filterCount; i ++)
       {
              nsMsgFilter *filter;
              if (GetMsgFilterAt(i, &filter) == NS_OK && filter != nsnull)
              {
                     filter->SetFilterList(this);
      
      // if the filter is temporary, don't write it to disk
      PRBool isTemporary;
      err = filter->GetTemporary(&isTemporary);
      if (NS_SUCCEEDED(err) && !isTemporary) {
        if ((err = filter->SaveToTextFile(aStream)) != NS_OK)
                              break;
      }

                     NS_RELEASE(filter);
              }
              else
                     break;
       }
  if (NS_SUCCEEDED(err))
    m_arbitraryHeaders.SetLength(0);
       return err;
}

Here is the call graph for this function:

void nsIMsgFilterList::setFilterAt ( in unsigned long  filterIndex,
in nsIMsgFilter  filter 
) [inherited]
char nsMsgFilterList::SkipWhitespace ( nsIOFileStream aStream) [protected]

Definition at line 460 of file nsMsgFilterList.cpp.

{
  char ch;
  do
  {
    ch = ReadChar(aStream);
  } while (nsCRT::IsAsciiSpace((PRUnichar)ch));
  return ch;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 470 of file nsMsgFilterList.cpp.

{
  return str.Equals("yes") ;
}

Here is the caller graph for this function:

Definition at line 142 of file nsMsgFilterList.cpp.

{
  // this will flush and close the steam
  nsresult rv = SetLogStream(nsnull);
  NS_ENSURE_SUCCESS(rv,rv);

  nsCOMPtr <nsIFileSpec> file;
  rv = GetLogFileSpec(getter_AddRefs(file));
  NS_ENSURE_SUCCESS(rv,rv);

  rv = file->Truncate(0);
  NS_ENSURE_SUCCESS(rv,rv);
  return rv;
}

Here is the call graph for this function:

void nsIMsgFilterList::writeWstrAttr ( in nsMsgFilterFileAttribValue  attrib,
in wstring  value,
in nsIOFileStream  stream 
) [inherited]

Member Data Documentation

Definition at line 73 of file nsIMsgFilterList.idl.

Definition at line 67 of file nsIMsgFilterList.idl.

Definition at line 68 of file nsIMsgFilterList.idl.

Definition at line 69 of file nsIMsgFilterList.idl.

Definition at line 64 of file nsIMsgFilterList.idl.

Definition at line 63 of file nsIMsgFilterList.idl.

Definition at line 61 of file nsIMsgFilterList.idl.

Definition at line 62 of file nsIMsgFilterList.idl.

Definition at line 59 of file nsIMsgFilterList.idl.

Definition at line 66 of file nsIMsgFilterList.idl.

Definition at line 65 of file nsIMsgFilterList.idl.

Definition at line 60 of file nsIMsgFilterList.idl.

Definition at line 100 of file nsIMsgFilterList.idl.

readonly attribute unsigned long nsIMsgFilterList::filterCount [inherited]

Definition at line 75 of file nsIMsgFilterList.idl.

Definition at line 71 of file nsIMsgFilterList.idl.

Definition at line 90 of file nsIMsgFilterList.idl.

Definition at line 126 of file nsIMsgFilterList.idl.

Definition at line 127 of file nsIMsgFilterList.idl.

Definition at line 102 of file nsMsgFilterList.h.

Definition at line 99 of file nsMsgFilterList.h.

Definition at line 103 of file nsMsgFilterList.h.

Definition at line 95 of file nsMsgFilterList.h.

Definition at line 100 of file nsMsgFilterList.h.

Definition at line 101 of file nsMsgFilterList.h.

Definition at line 98 of file nsMsgFilterList.h.

Definition at line 96 of file nsMsgFilterList.h.

Definition at line 109 of file nsMsgFilterList.h.

Definition at line 97 of file nsMsgFilterList.h.

Definition at line 77 of file nsMsgFilterList.h.

Definition at line 104 of file nsMsgFilterList.h.

Definition at line 74 of file nsIMsgFilterList.idl.

readonly attribute short nsIMsgFilterList::version [inherited]

Definition at line 72 of file nsIMsgFilterList.idl.


The documentation for this class was generated from the following files: