/src/spotify-json/src/detail/bitset.cpp
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2016-2019 Spotify AB |
3 | | * |
4 | | * Licensed under the Apache License, Version 2.0 (the "License"); you may not |
5 | | * use this file except in compliance with the License. You may obtain a copy of |
6 | | * 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, WITHOUT |
12 | | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
13 | | * License for the specific language governing permissions and limitations under |
14 | | * the License. |
15 | | */ |
16 | | |
17 | | #include <spotify/json/detail/bitset.hpp> |
18 | | |
19 | | namespace spotify { |
20 | | namespace json { |
21 | | namespace detail { |
22 | | |
23 | 2.32k | bitset_base::~bitset_base() = default; |
24 | | |
25 | 2.32k | bitset_base::bitset_base(const std::size_t size, uint8_t *inline_base) { |
26 | 2.32k | if (inline_base) { |
27 | 2.32k | _base = inline_base; |
28 | 2.32k | } else { |
29 | 0 | _vector.reset(new std::vector<uint8_t>((size + 7) / 8)); |
30 | 0 | _base = _vector->data(); |
31 | 0 | } |
32 | 2.32k | } |
33 | | |
34 | | } // namespace detail |
35 | | } // namespace json |
36 | | } // namespace spotify |