Microsoft Information Protection SDK - C++ 1.17
API Reference Documentation for C++
Loading...
Searching...
No Matches
metadata_version.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 */
32#ifndef API_MIP_UPE_METADATA_VERSION_H_
33#define API_MIP_UPE_METADATA_VERSION_H_
34
35#include <cstdint>
36
37#include "mip/mip_namespace.h"
38
39using std::uint32_t;
40
41MIP_NAMESPACE_BEGIN
42
46enum class MetadataVersionFormat : unsigned int {
47 DEFAULT = 0,
48 ONE_LABEL_PER_TENANT = 1 << 0
49};
50
55 return static_cast<MetadataVersionFormat>(static_cast<unsigned int>(a) | static_cast<unsigned int>(b));
56}
61 return static_cast<MetadataVersionFormat>(static_cast<unsigned int>(a) & static_cast<unsigned int>(b));
62}
67 return static_cast<MetadataVersionFormat>(static_cast<unsigned int>(a) ^ static_cast<unsigned int>(b));
68}
69
74public:
80 MetadataVersion(uint32_t version, MetadataVersionFormat flags) : mVersion(version), mFlags(flags) {}
86 virtual uint32_t GetValue() const { return mVersion; }
92 virtual bool HasFlag(MetadataVersionFormat flag) const { return flag == (flag & mFlags); }
98 virtual MetadataVersionFormat GetFlags() const { return mFlags; }
100 operator uint32_t() const { return mVersion; }
101 virtual ~MetadataVersion() {}
102private:
103 uint32_t mVersion;
106};
107
108MIP_NAMESPACE_END
109
110#endif // API_MIP_UPE_METADATA_VERSION_H_
Interface for a MetadataVersion. MetadataVersion determines which metadata is active and how it is pr...
Definition metadata_version.h:73
virtual bool HasFlag(MetadataVersionFormat flag) const
Get whether a specific flag is set.
Definition metadata_version.h:92
virtual MetadataVersionFormat GetFlags() const
Get the flags that define how metadata is processed for a given version.
Definition metadata_version.h:98
virtual uint32_t GetValue() const
Get the numerical version.
Definition metadata_version.h:86
MetadataVersion(uint32_t version, MetadataVersionFormat flags)
MetadataVersion constructor.
Definition metadata_version.h:80
MetadataVersionFormat operator&(MetadataVersionFormat a, MetadataVersionFormat b)
And (&) operator for MetadataVersionFormat type enum.
Definition metadata_version.h:60
MetadataVersionFormat operator^(MetadataVersionFormat a, MetadataVersionFormat b)
Xor (^) operator for MetadataVersionFormat type enum.
Definition metadata_version.h:66
MetadataVersionFormat operator|(MetadataVersionFormat a, MetadataVersionFormat b)
Or (|) operator for MetadataVersionFormat type enum.
Definition metadata_version.h:54
MetadataVersionFormat
Different algorithms to use when processing metadata.
Definition metadata_version.h:46
MIP namespace macros.