Couchbase Transactions C++ Client  1.0.0
Transactions client for couchbase
lookup_in_spec.hxx
Go to the documentation of this file.
1 /*
2  * Copyright 2021 Couchbase, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include <string>
19 
26 namespace couchbase
27 {
28 class collection;
29 
30 enum class lookup_in_spec_type { LOOKUP_IN_GET, LOOKUP_IN_FULLDOC_GET };
39 {
40  friend collection;
41 
42  public:
49  static lookup_in_spec get(const std::string& path)
50  {
51  return lookup_in_spec(lookup_in_spec_type::LOOKUP_IN_GET, path);
52  }
53 
60  {
61  return lookup_in_spec(lookup_in_spec_type::LOOKUP_IN_FULLDOC_GET);
62  }
63 
70 
71  private:
72  lookup_in_spec_type type_;
73  std::string path_;
74  uint32_t flags_;
75 
76  explicit lookup_in_spec(lookup_in_spec_type type, std::string path = "")
77  : type_(type)
78  , path_(std::move(path))
79  , flags_(0)
80  {
81  }
82 };
83 } // namespace couchbase
static lookup_in_spec fulldoc_get()
Definition: lookup_in_spec.hxx:59
Definition: bucket.hxx:33
Specify specific elements in a document to look up.
Definition: lookup_in_spec.hxx:38
STL namespace.
lookup_in_spec & xattr()
Exposes collection-level kv operations.
Definition: collection.hxx:46