Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
nsAOLCiter Class Reference

Mail citations using the AOL style >> This is a citation <<. More...

#include <nsAOLCiter.h>

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

List of all members.

Public Member Functions

 nsAOLCiter ()
 Mail citations using the AOL style >> This is a citation <<.
virtual ~nsAOLCiter ()
NS_DECL_ISUPPORTS NS_IMETHOD GetCiteString (const nsAString &aInString, nsAString &aOutString)
NS_IMETHOD StripCites (const nsAString &aInString, nsAString &aOutString)
NS_IMETHOD Rewrap (const nsAString &aInString, PRUint32 aWrapCol, PRUint32 aFirstLineOffset, PRBool aRespectNewlines, nsAString &aOutString)
DOMString GetCiteString (in DOMString aInString)
DOMString StripCites (in DOMString aInString)
DOMString Rewrap (in DOMString aInString, in unsigned long aWrapCol, in unsigned long aFirstLineOffset, in boolean aRespectNewlines)

Detailed Description

Mail citations using the AOL style >> This is a citation <<.

Definition at line 47 of file nsAOLCiter.h.


Constructor & Destructor Documentation

Mail citations using the AOL style >> This is a citation <<.

Definition at line 48 of file nsAOLCiter.cpp.

{
}
nsAOLCiter::~nsAOLCiter ( ) [virtual]

Definition at line 52 of file nsAOLCiter.cpp.

{
}

Member Function Documentation

DOMString nsICiter::GetCiteString ( in DOMString  aInString) [inherited]
NS_IMETHODIMP nsAOLCiter::GetCiteString ( const nsAString &  aInString,
nsAString &  aOutString 
)

Definition at line 59 of file nsAOLCiter.cpp.

{
  aOutString.AssignLiteral("\n\n>> ");
  aOutString += aInString;

  // See if the last char is a newline, and replace it if so
  PRUnichar newline ('\n');
  if (aOutString.Last() == newline)
  {
    aOutString.SetLength(aOutString.Length() - 1);
  }

  aOutString.AppendLiteral(" <<\n");

  return NS_OK;
}
DOMString nsICiter::Rewrap ( in DOMString  aInString,
in unsigned long  aWrapCol,
in unsigned long  aFirstLineOffset,
in boolean  aRespectNewlines 
) [inherited]
NS_IMETHODIMP nsAOLCiter::Rewrap ( const nsAString &  aInString,
PRUint32  aWrapCol,
PRUint32  aFirstLineOffset,
PRBool  aRespectNewlines,
nsAString &  aOutString 
)

Definition at line 101 of file nsAOLCiter.cpp.

{
  nsString citeString;
  return nsWrapUtils::Rewrap(aInString, aWrapCol, aFirstLineOffset,
                             aRespectNewlines, citeString,
                             aOutString);
}
DOMString nsICiter::StripCites ( in DOMString  aInString) [inherited]
NS_IMETHODIMP nsAOLCiter::StripCites ( const nsAString &  aInString,
nsAString &  aOutString 
)

Definition at line 77 of file nsAOLCiter.cpp.

{
  // Remove the beginning cites, if any:
  nsAutoString tOutputString;
  nsReadingIterator <PRUnichar> iter, enditer;
  aInString.BeginReading(iter);
  aInString.EndReading(enditer);
  if (StringBeginsWith(aInString, NS_LITERAL_STRING(">>")))
  {
    iter.advance(2);
    while (nsCRT::IsAsciiSpace(*iter))
      ++iter;
    AppendUnicodeTo(iter, enditer, tOutputString);
  }
  else
    CopyUnicodeTo(iter, enditer, tOutputString);

  // Remove the end cites, if any:
  tOutputString.Trim("<", PR_FALSE, PR_TRUE, PR_FALSE);
  aOutString.Assign(tOutputString);
  return NS_OK;
}

Here is the call graph for this function:


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