preprocessor: make CPlusPlus::Internal::ByteArrayRef public

Change-Id: Ief6ea71f750b6ba19b650050bae376f4ad82d9d2
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2012-04-18 17:35:28 +02:00
committed by hjk
parent d4b4a75603
commit 17c114fde8
9 changed files with 17 additions and 16 deletions

View File

@@ -64,7 +64,7 @@ public:
virtual void macroAdded(const Macro &) {}
virtual void passedMacroDefinitionCheck(unsigned, const Macro &) {}
virtual void failedMacroDefinitionCheck(unsigned, const Internal::ByteArrayRef &) {}
virtual void failedMacroDefinitionCheck(unsigned, const ByteArrayRef &) {}
virtual void startExpandingMacro(unsigned,
const Macro &,

View File

@@ -2,7 +2,7 @@
#include <cstring>
using namespace CPlusPlus::Internal;
using namespace CPlusPlus;
bool ByteArrayRef::startsWith(const char *s) const
{
@@ -23,7 +23,7 @@ int ByteArrayRef::count(char ch) const
return num;
}
void PPToken::squeeze()
void Internal::PPToken::squeeze()
{
if (isValid()) {
m_src = m_src.mid(offset, length());

View File

@@ -7,7 +7,6 @@
#include <QByteArray>
namespace CPlusPlus {
namespace Internal {
class CPLUSPLUS_EXPORT ByteArrayRef
{
@@ -80,6 +79,8 @@ inline bool operator==(const QByteArray &other, const ByteArrayRef &ref)
inline bool operator!=(const QByteArray &other, const ByteArrayRef &ref)
{ return ref != other; }
namespace Internal {
class CPLUSPLUS_EXPORT PPToken: public Token
{
public:

View File

@@ -43,7 +43,7 @@ QT_END_NAMESPACE
namespace CPlusPlus {
namespace Internal { class ByteArrayRef; }
class ByteArrayRef;
class Macro;
class CPLUSPLUS_EXPORT MacroArgumentReference
@@ -81,7 +81,7 @@ public:
virtual void macroAdded(const Macro &macro) = 0;
virtual void passedMacroDefinitionCheck(unsigned offset, const Macro &macro) = 0;
virtual void failedMacroDefinitionCheck(unsigned offset, const Internal::ByteArrayRef &name) = 0;
virtual void failedMacroDefinitionCheck(unsigned offset, const ByteArrayRef &name) = 0;
virtual void startExpandingMacro(unsigned offset,
const Macro &macro,

View File

@@ -150,7 +150,7 @@ void Environment::reset()
_hash_count = 401;
}
bool Environment::isBuiltinMacro(const Internal::ByteArrayRef &s)
bool Environment::isBuiltinMacro(const ByteArrayRef &s)
{
if (s.length() != 8)
return false;
@@ -236,7 +236,7 @@ Macro *Environment::resolve(const QByteArray &name) const
return it;
}
Macro *Environment::resolve(const Internal::ByteArrayRef &name) const
Macro *Environment::resolve(const ByteArrayRef &name) const
{
if (! _macros)
return 0;
@@ -262,7 +262,7 @@ unsigned Environment::hashCode(const QByteArray &s)
return hash_value;
}
unsigned Environment::hashCode(const Internal::ByteArrayRef &s)
unsigned Environment::hashCode(const ByteArrayRef &s)
{
unsigned hash_value = 0;

View File

@@ -79,7 +79,7 @@ public:
Macro *remove(const QByteArray &name);
Macro *resolve(const QByteArray &name) const;
Macro *resolve(const Internal::ByteArrayRef &name) const;
Macro *resolve(const ByteArrayRef &name) const;
iterator firstMacro() const;
iterator lastMacro() const;
@@ -87,11 +87,11 @@ public:
void reset();
void addMacros(const QList<Macro> &macros);
static bool isBuiltinMacro(const Internal::ByteArrayRef &name);
static bool isBuiltinMacro(const ByteArrayRef &name);
private:
static unsigned hashCode(const QByteArray &s);
static unsigned hashCode(const Internal::ByteArrayRef &s);
static unsigned hashCode(const ByteArrayRef &s);
void rehash();
public:

View File

@@ -147,7 +147,7 @@ private:
void handleIfDefDirective(bool checkUndefined, PPToken *tk);
void handleUndefDirective(PPToken *tk);
static bool isQtReservedWord(const Internal::ByteArrayRef &name);
static bool isQtReservedWord(const ByteArrayRef &name);
void pushState(const State &newState);
void popState();
@@ -174,7 +174,7 @@ private:
inline void out(const char *s) const
{ if (m_state.m_result) m_state.m_result->append(s); }
inline void out(const Internal::ByteArrayRef &ref) const
inline void out(const ByteArrayRef &ref) const
{ if (m_state.m_result) m_state.m_result->append(ref.start(), ref.length()); }
QString string(const char *first, int len) const;