Microsoft Information Protection SDK - C++ 1.17
API Reference Documentation for C++
Loading...
Searching...
No Matches
storage_table.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (c) Microsoft Corporation.
4 * All rights reserved.
5 *
6 * This code is licensed under the MIT License.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files(the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions :
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 *
26 */
33#ifndef API_MIP_STORAGE_TABLE_H_
34#define API_MIP_STORAGE_TABLE_H_
35
36#include <cstdint>
37#include <string>
38#include <vector>
39
40#include "mip/mip_namespace.h"
41
42using std::uint32_t;
43
44MIP_NAMESPACE_BEGIN
45
49enum class ColumnMatch {
50 Equals = 0, /*< Match column if data equals a specific value (=) */
51 LessThan = 1, /*< Match column if data is less than a specific value (<) */
52 GreaterThan = 2, /*< Match column if data is greater than a specific value (>) */
53 LessThanEqualTo = 3, /*< Match column if data is less than or equal to a specific value (<=) */
54 GreaterThanEqualTo = 4, /*< Match column if data is greater than or equal to a specific value (>=) */
55 NotEquals = 5, /*< Match column if data is not equal to a specific value (<>) */
56};
57
62public:
71#if !defined(SWIG) && !defined(SWIG_DIRECTORS)
72 [[deprecated("Insert method is deprecated, instead use InsertOrReplace method")]]
73#endif
74 virtual void Insert(const std::vector<std::string>& allColumnValues)
75 {
76 InsertOrReplace(allColumnValues);
77 }
78
84 virtual void InsertOrReplace(const std::vector<std::string>& allColumnValues) = 0;
85
91 virtual std::vector<std::vector<std::string>> List() = 0;
92
102 virtual void Update(
103 const std::vector<std::string>& updateColumns,
104 const std::vector<std::string>& updateValues,
105 const std::vector<std::string>& queryColumns,
106 const std::vector<std::string>& queryValues) = 0;
107
115 virtual void Delete(
116 const std::vector<std::string>& queryColumns,
117 const std::vector<std::string>& queryValues) = 0;
118
127 virtual std::vector<std::vector<std::string>> Find(
128 const std::vector<std::string>& queryColumns,
129 const std::vector<std::string>& queryValues) = 0;
130
132 virtual ~StorageTable() {}
133protected:
134 StorageTable() {}
136};
137
144public:
158 virtual uint32_t DeleteRange(
159 const std::vector<std::string>& queryColumns,
160 const std::vector<std::string>& queryValues,
161 const std::vector<ColumnMatch>& relations) = 0;
162
164 virtual ~StorageTableV2() {}
165protected:
168};
169
170MIP_NAMESPACE_END
171#endif // API_MIP_STORAGE_TABLE_H_
An extension to the class that defines the interface to the MIP SDK storage table used for caching.
Definition storage_table.h:143
virtual uint32_t DeleteRange(const std::vector< std::string > &queryColumns, const std::vector< std::string > &queryValues, const std::vector< ColumnMatch > &relations)=0
Delete a set of rows with values greater or lesser than a target value. Need to set storage table ver...
A class that defines the interface to the MIP SDK storage table used for caching.
Definition storage_table.h:61
virtual void Delete(const std::vector< std::string > &queryColumns, const std::vector< std::string > &queryValues)=0
Delete a set of rows specified by queryColumns and queryValues.
virtual void Insert(const std::vector< std::string > &allColumnValues)
Adds a row to the table.
Definition storage_table.h:74
virtual void InsertOrReplace(const std::vector< std::string > &allColumnValues)=0
Adds a row to the table.
virtual void Update(const std::vector< std::string > &updateColumns, const std::vector< std::string > &updateValues, const std::vector< std::string > &queryColumns, const std::vector< std::string > &queryValues)=0
Update a set of rows within the table.
virtual std::vector< std::vector< std::string > > List()=0
List all the rows in the table.
virtual std::vector< std::vector< std::string > > Find(const std::vector< std::string > &queryColumns, const std::vector< std::string > &queryValues)=0
Find a set of rows specified by queryColumns and queryValues. This method can return multiple rows ba...
MIP namespace macros.
ColumnMatch
Defines actions for column specification based on values.
Definition storage_table.h:49