summaryrefslogtreecommitdiff
path: root/src/mongo/db/json.h
diff options
context:
space:
mode:
authorShaun Verch <shaun.verch@10gen.com>2013-10-09 13:34:10 -0400
committerShaun Verch <shaun.verch@10gen.com>2013-10-09 17:53:02 -0400
commit15ec6531ea275dd651487df198e24be1ae248315 (patch)
tree7a6bfc2cfc2ee72f31c665c7d1e4aab53cb64ef4 /src/mongo/db/json.h
parent91480e08d9a6dd41ad6118ee0bf5461a99cbdbc3 (diff)
downloadmongo-15ec6531ea275dd651487df198e24be1ae248315.tar.gz
Rename internal JSON parser token and field expectation functions
Diffstat (limited to 'src/mongo/db/json.h')
-rw-r--r--src/mongo/db/json.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/mongo/db/json.h b/src/mongo/db/json.h
index c6bc3ef7d44..693a2212336 100644
--- a/src/mongo/db/json.h
+++ b/src/mongo/db/json.h
@@ -338,15 +338,31 @@ namespace mongo {
* @return true if the given token matches the next non whitespace
* sequence in our buffer, and false if the token doesn't match or
* we reach the end of our buffer. Do not update the pointer to our
+ * buffer (same as calling readTokenImpl with advance=false).
+ */
+ inline bool peekToken(const char* token);
+
+ /**
+ * @return true if the given token matches the next non whitespace
+ * sequence in our buffer, and false if the token doesn't match or
+ * we reach the end of our buffer. Updates the pointer to our
+ * buffer (same as calling readTokenImpl with advance=true).
+ */
+ inline bool readToken(const char* token);
+
+ /**
+ * @return true if the given token matches the next non whitespace
+ * sequence in our buffer, and false if the token doesn't match or
+ * we reach the end of our buffer. Do not update the pointer to our
* buffer if advance is false.
*/
- bool accept(const char* token, bool advance=true);
+ bool readTokenImpl(const char* token, bool advance=true);
/**
* @return true if the next field in our stream matches field.
* Handles single quoted, double quoted, and unquoted field names
*/
- bool acceptField(const StringData& field);
+ bool readField(const StringData& field);
/**
* @return true if matchChar is in matchSet