forked from qt-creator/qt-creator
preprocessor: make CPlusPlus::Internal::ByteArrayRef public
Change-Id: Ief6ea71f750b6ba19b650050bae376f4ad82d9d2 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -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 &,
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 ¯o) = 0;
|
||||
|
||||
virtual void passedMacroDefinitionCheck(unsigned offset, const Macro ¯o) = 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 ¯o,
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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> ¯os);
|
||||
|
||||
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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user