зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1035884 - Follow-up: Remove SubstringType template argument for ns{CharSeparated,Whitespace}Tokenizer. r=froydnj
This commit is contained in:
Родитель
25b496a4b2
Коммит
77bec57910
|
@ -29,12 +29,11 @@
|
||||||
* The function used for whitespace detection is a template argument.
|
* The function used for whitespace detection is a template argument.
|
||||||
* By default, it is NS_IsAsciiWhitespace.
|
* By default, it is NS_IsAsciiWhitespace.
|
||||||
*/
|
*/
|
||||||
template<typename SubstringType,
|
template<typename DependentSubstringType, bool IsWhitespace(char16_t)>
|
||||||
typename DependentSubstringType,
|
|
||||||
bool IsWhitespace(char16_t)>
|
|
||||||
class nsTCharSeparatedTokenizer
|
class nsTCharSeparatedTokenizer
|
||||||
{
|
{
|
||||||
typedef typename SubstringType::char_type CharType;
|
typedef typename DependentSubstringType::char_type CharType;
|
||||||
|
typedef typename DependentSubstringType::substring_type SubstringType;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Flags -- only one for now. If we need more, they should be defined to
|
// Flags -- only one for now. If we need more, they should be defined to
|
||||||
|
@ -166,16 +165,13 @@ private:
|
||||||
|
|
||||||
template<bool IsWhitespace(char16_t) = NS_IsAsciiWhitespace>
|
template<bool IsWhitespace(char16_t) = NS_IsAsciiWhitespace>
|
||||||
class nsCharSeparatedTokenizerTemplate
|
class nsCharSeparatedTokenizerTemplate
|
||||||
: public nsTCharSeparatedTokenizer<nsSubstring,
|
: public nsTCharSeparatedTokenizer<nsDependentSubstring, IsWhitespace>
|
||||||
nsDependentSubstring,
|
|
||||||
IsWhitespace>
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nsCharSeparatedTokenizerTemplate(const nsSubstring& aSource,
|
nsCharSeparatedTokenizerTemplate(const nsSubstring& aSource,
|
||||||
char16_t aSeparatorChar,
|
char16_t aSeparatorChar,
|
||||||
uint32_t aFlags = 0)
|
uint32_t aFlags = 0)
|
||||||
: nsTCharSeparatedTokenizer<nsSubstring,
|
: nsTCharSeparatedTokenizer<nsDependentSubstring,
|
||||||
nsDependentSubstring,
|
|
||||||
IsWhitespace>(aSource, aSeparatorChar, aFlags)
|
IsWhitespace>(aSource, aSeparatorChar, aFlags)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -195,16 +191,13 @@ public:
|
||||||
|
|
||||||
template<bool IsWhitespace(char16_t) = NS_IsAsciiWhitespace>
|
template<bool IsWhitespace(char16_t) = NS_IsAsciiWhitespace>
|
||||||
class nsCCharSeparatedTokenizerTemplate
|
class nsCCharSeparatedTokenizerTemplate
|
||||||
: public nsTCharSeparatedTokenizer<nsCSubstring,
|
: public nsTCharSeparatedTokenizer<nsDependentCSubstring, IsWhitespace>
|
||||||
nsDependentCSubstring,
|
|
||||||
IsWhitespace>
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nsCCharSeparatedTokenizerTemplate(const nsCSubstring& aSource,
|
nsCCharSeparatedTokenizerTemplate(const nsCSubstring& aSource,
|
||||||
char aSeparatorChar,
|
char aSeparatorChar,
|
||||||
uint32_t aFlags = 0)
|
uint32_t aFlags = 0)
|
||||||
: nsTCharSeparatedTokenizer<nsCSubstring,
|
: nsTCharSeparatedTokenizer<nsDependentCSubstring,
|
||||||
nsDependentCSubstring,
|
|
||||||
IsWhitespace>(aSource, aSeparatorChar, aFlags)
|
IsWhitespace>(aSource, aSeparatorChar, aFlags)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,12 +10,11 @@
|
||||||
#include "nsDependentSubstring.h"
|
#include "nsDependentSubstring.h"
|
||||||
#include "nsCRT.h"
|
#include "nsCRT.h"
|
||||||
|
|
||||||
template<typename SubstringType,
|
template<typename DependentSubstringType, bool IsWhitespace(char16_t)>
|
||||||
typename DependentSubstringType,
|
|
||||||
bool IsWhitespace(char16_t)>
|
|
||||||
class nsTWhitespaceTokenizer
|
class nsTWhitespaceTokenizer
|
||||||
{
|
{
|
||||||
typedef typename SubstringType::char_type CharType;
|
typedef typename DependentSubstringType::char_type CharType;
|
||||||
|
typedef typename DependentSubstringType::substring_type SubstringType;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
nsTWhitespaceTokenizer(const SubstringType& aSource)
|
nsTWhitespaceTokenizer(const SubstringType& aSource)
|
||||||
|
@ -83,13 +82,11 @@ private:
|
||||||
|
|
||||||
template<bool IsWhitespace(char16_t) = NS_IsAsciiWhitespace>
|
template<bool IsWhitespace(char16_t) = NS_IsAsciiWhitespace>
|
||||||
class nsWhitespaceTokenizerTemplate
|
class nsWhitespaceTokenizerTemplate
|
||||||
: public nsTWhitespaceTokenizer<nsSubstring, nsDependentSubstring,
|
: public nsTWhitespaceTokenizer<nsDependentSubstring, IsWhitespace>
|
||||||
IsWhitespace>
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nsWhitespaceTokenizerTemplate(const nsSubstring& aSource)
|
nsWhitespaceTokenizerTemplate(const nsSubstring& aSource)
|
||||||
: nsTWhitespaceTokenizer<nsSubstring, nsDependentSubstring,
|
: nsTWhitespaceTokenizer<nsDependentSubstring, IsWhitespace>(aSource)
|
||||||
IsWhitespace>(aSource)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -106,13 +103,11 @@ public:
|
||||||
|
|
||||||
template<bool IsWhitespace(char16_t) = NS_IsAsciiWhitespace>
|
template<bool IsWhitespace(char16_t) = NS_IsAsciiWhitespace>
|
||||||
class nsCWhitespaceTokenizerTemplate
|
class nsCWhitespaceTokenizerTemplate
|
||||||
: public nsTWhitespaceTokenizer<nsCSubstring, nsDependentCSubstring,
|
: public nsTWhitespaceTokenizer<nsDependentCSubstring, IsWhitespace>
|
||||||
IsWhitespace>
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nsCWhitespaceTokenizerTemplate(const nsCSubstring& aSource)
|
nsCWhitespaceTokenizerTemplate(const nsCSubstring& aSource)
|
||||||
: nsTWhitespaceTokenizer<nsCSubstring, nsDependentCSubstring,
|
: nsTWhitespaceTokenizer<nsDependentCSubstring, IsWhitespace>(aSource)
|
||||||
IsWhitespace>(aSource)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Загрузка…
Ссылка в новой задаче