Back to index

lightning-sunbird  0.9+nobinonly
nsDefaultURIFixup.cpp File Reference
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsNetUtil.h"
#include "nsEscape.h"
#include "nsCRT.h"
#include "nsIPrefService.h"
#include "nsIPrefLocalizedString.h"
#include "nsIPlatformCharset.h"
#include "nsILocalFile.h"
#include "nsIURIFixup.h"
#include "nsDefaultURIFixup.h"

Go to the source code of this file.


static nsresult MangleKeywordIntoURI (const char *aKeyword, const char *aURL, nsCString &query)
nsresult NS_NewURIFixup (nsIURIFixup **aURIFixup)

Function Documentation

static nsresult MangleKeywordIntoURI ( const char *  aKeyword,
const char *  aURL,
nsCString query 
) [static]

Definition at line 356 of file nsDefaultURIFixup.cpp.

    query = (*aKeyword == '?') ? (aKeyword + 1) : aKeyword;
    query.Trim(" "); // pull leading/trailing spaces.

    // encode
    char * encQuery = nsEscape(query.get(), url_XPAlphas);
    if (!encQuery) return NS_ERROR_OUT_OF_MEMORY;

    // prepend the query with the keyword url
    // XXX this url should come from somewhere else
    query.Insert(aURL, 0);
    return NS_OK;

Here is the call graph for this function:

nsresult NS_NewURIFixup ( nsIURIFixup **  aURIFixup)

Definition at line 798 of file nsDefaultURIFixup.cpp.

    nsDefaultURIFixup *fixup = new nsDefaultURIFixup;
    if (fixup == nsnull)
        return NS_ERROR_OUT_OF_MEMORY;
    return fixup->QueryInterface(NS_GET_IID(nsIURIFixup), (void **) aURIFixup);