Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsFileStream.cpp File Reference
#include "nsFileStream.h"
#include "nsFileSpec.h"
#include "nsIFileSpec.h"
#include "nsIStringStream.h"
#include "nsInt64.h"
#include <string.h>
#include <stdio.h>

Go to the source code of this file.

Functions

static void TidyEndOfLine (char *&cp)
nsOutputStream & nsEndl (nsOutputStream &os)

Function Documentation

nsOutputStream& nsEndl ( nsOutputStream &  os)

Definition at line 382 of file nsFileStream.cpp.

{
#if defined(XP_WIN) || defined(XP_OS2)
    os.write("\r\n", 2);
#elif defined (XP_MAC)
    os.put('\r');
#else
    os.put('\n');
#endif
    //os.flush();
    return os;
} // nsEndl

Here is the caller graph for this function:

static void TidyEndOfLine ( char *&  cp) [static]

Definition at line 87 of file nsFileStream.cpp.

{
    char ch = *cp;
    *cp++ = '\0'; // terminate at the newline, then skip past it
    if ((ch == '\n' && *cp == '\r') || (ch == '\r' && *cp == '\n'))
        cp++; // possibly a pair.
}