summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/field_path.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/field_path.h')
-rwxr-xr-xsrc/mongo/db/pipeline/field_path.h35
1 files changed, 31 insertions, 4 deletions
diff --git a/src/mongo/db/pipeline/field_path.h b/src/mongo/db/pipeline/field_path.h
index d54c2edd1da..618eb283e3e 100755
--- a/src/mongo/db/pipeline/field_path.h
+++ b/src/mongo/db/pipeline/field_path.h
@@ -24,17 +24,26 @@ namespace mongo {
public:
virtual ~FieldPath();
+ /**
+ Constructor.
+
+ @param fieldPath the dotted field path string
+ */
FieldPath(const string &fieldPath);
+
+ /**
+ Constructor.
+ */
FieldPath();
- /*
+ /**
Get the number of path elements in the field path.
@returns the number of path elements
*/
size_t getPathLength() const;
- /*
+ /**
Get a particular path element from the path.
@param i the index of the path element
@@ -42,7 +51,7 @@ namespace mongo {
*/
string getFieldName(size_t i) const;
- /*
+ /**
Get the full path.
@param fieldPrefix whether or not to include the field prefix
@@ -50,7 +59,7 @@ namespace mongo {
*/
string getPath(bool fieldPrefix) const;
- /*
+ /**
Write the full path.
@param outStream where to write the path to
@@ -58,8 +67,22 @@ namespace mongo {
*/
void writePath(ostream &outStream, bool fieldPrefix) const;
+ /**
+ Assignment operator.
+
+ @param rRHS right hand side of the assignment
+ */
FieldPath &operator=(const FieldPath &rRHS);
+ /**
+ Get the prefix string.
+
+ @returns the prefix string
+ */
+ static const char *getPrefix();
+
+ static const char prefix[];
+
private:
vector<string> vFieldName;
};
@@ -78,5 +101,9 @@ namespace mongo {
return vFieldName[i];
}
+ inline const char *FieldPath::getPrefix() {
+ return prefix;
+ }
+
}