SDK  2.1.4 [async]
CloudBackend Software Development Kit - SDK API for C++
Utility.h
1 /*
2  SDK Utility definitions.
3  Copyright © CloudBackend AB 2020-2023.
4  */
5 #ifndef INCLUDE_SDK_UTILITY_H_
6 #define INCLUDE_SDK_UTILITY_H_
7 
8 #include <stdint.h>
9 #include <vector>
10 #include <map>
11 #include <memory>
12 #include <string>
13 #include <utility>
14 
15 namespace cbe {
16 
21 struct ShareData {
22  template <class ShareDataT>
23  ShareData(ShareDataT&& rh) : id{rh.id}, isUserId{rh.isUserId} {}
24  ShareData(uint64_t id, bool isUserId) : id{id}, isUserId{isUserId} {}
25  //DEFAULT = 0, ID for userId or groupId
26  uint64_t id;
27  //DEFAULT == TRUE, UserId = True if userID and false if groupId
28  bool isUserId;
29 };
30 
39 template<typename IdT>
40 class MatchesID {
41  IdT _id;
42 
43 public:
44  MatchesID(const IdT& id) :
45  _id(id) {
46  }
47 
48  template<class ItemT>
49  bool operator()(const ItemT& item) const {
50  return item.id == _id;
51  }
52 };
53 }
54 #endif //INCLUDE_SDK_UTILITY_H_
Search lists with ID.
Definition: Utility.h:40
Root namespace for the CloudBackend SDK API.
Definition: Account.h:22
Definition: Utility.h:21