summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/qpid/broker/SelectorToken.h
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/src/qpid/broker/SelectorToken.h')
-rw-r--r--qpid/cpp/src/qpid/broker/SelectorToken.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/broker/SelectorToken.h b/qpid/cpp/src/qpid/broker/SelectorToken.h
index 91fb1d5c36..bd60b69dce 100644
--- a/qpid/cpp/src/qpid/broker/SelectorToken.h
+++ b/qpid/cpp/src/qpid/broker/SelectorToken.h
@@ -67,6 +67,7 @@ typedef enum {
struct Token {
TokenType type;
std::string val;
+ std::string::const_iterator tokenStart;
Token()
{}
@@ -76,14 +77,23 @@ struct Token {
val(v)
{}
+ Token(TokenType t, const std::string::const_iterator& s, const std::string& v) :
+ type(t),
+ val(v),
+ tokenStart(s)
+ {}
+
Token(TokenType t, const std::string::const_iterator& s, const std::string::const_iterator& e) :
type(t),
- val(std::string(s,e))
+ val(std::string(s,e)),
+ tokenStart(s)
{}
bool operator==(const Token& r) const
{
- return type == r.type && val == r.val;
+ return
+ (type == T_EOS && r.type == T_EOS) ||
+ (type == r.type && val == r.val);
}
};
@@ -100,6 +110,7 @@ class Tokeniser {
std::vector<Token> tokens;
unsigned int tokp;
+ std::string::const_iterator inStart;
std::string::const_iterator inp;
std::string::const_iterator inEnd;
@@ -107,6 +118,7 @@ public:
QPID_BROKER_EXTERN Tokeniser(const std::string::const_iterator& s, const std::string::const_iterator& e);
QPID_BROKER_EXTERN void returnTokens(unsigned int n = 1);
QPID_BROKER_EXTERN const Token& nextToken();
+ QPID_BROKER_EXTERN std::string remaining();
};
}}