Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
nsSVGFeatures.cpp File Reference
#include "nsString.h"
#include "nsSVGUtils.h"
#include "nsSVGFeaturesList.h"

Go to the source code of this file.

Defines

#define SVG_SUPPORTED_FEATURE(str)   if (lstr.Equals(NS_LITERAL_STRING(str).get())) return PR_TRUE;
#define SVG_UNSUPPORTED_FEATURE(str)

Functions

PRBool NS_SVG_TestFeature (const nsAString &fstr)
PRBool NS_SVG_TestFeatures (const nsAString &fstr)

Define Documentation


Function Documentation

PRBool NS_SVG_TestFeature ( const nsAString &  fstr)

Definition at line 45 of file nsSVGFeatures.cpp.

                                          {
  if (!nsSVGUtils::SVGEnabled()) {
    return PR_FALSE;
  }
  nsAutoString lstr(fstr);
  lstr.StripWhitespace();

#ifdef DEBUG_scooter
  NS_ConvertUTF16toUTF8 feature(lstr);
  printf("NS_SVG_TestFeature: testing for %s\n", feature.get());
#endif

#define SVG_SUPPORTED_FEATURE(str) if (lstr.Equals(NS_LITERAL_STRING(str).get())) return PR_TRUE;
#define SVG_UNSUPPORTED_FEATURE(str)
#include "nsSVGFeaturesList.h"
#undef SVG_SUPPORTED_FEATURE
#undef SVG_UNSUPPORTED_FEATURE
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool NS_SVG_TestFeatures ( const nsAString &  fstr)

Definition at line 67 of file nsSVGFeatures.cpp.

                                           {
  nsAutoString lstr(fstr);
  // Get an iterator on the string
  PRInt32 vbegin = 0;
  PRInt32 vlen = lstr.Length();
  while (vbegin < vlen) {
    PRInt32 vend = lstr.FindChar(PRUnichar(' '), vbegin);
    if (vend == kNotFound) {
      vend = vlen;
    }
    if (NS_SVG_TestFeature(Substring(lstr, vbegin, vend-vbegin)) == PR_FALSE) {
      return PR_FALSE;
    }
    vbegin = vend+1;
  }
  return PR_TRUE;
}

Here is the call graph for this function: