/src/brunsli/c/dec/state.cc
Line | Count | Source (jump to first uncovered line) |
1 | | // Copyright (c) Google LLC 2020 |
2 | | // |
3 | | // Use of this source code is governed by an MIT-style |
4 | | // license that can be found in the LICENSE file or at |
5 | | // https://opensource.org/licenses/MIT. |
6 | | |
7 | | #include "./state.h" |
8 | | |
9 | | #include <brotli/decode.h> |
10 | | #include "./state_internal.h" |
11 | | |
12 | | namespace brunsli { |
13 | | namespace internal { |
14 | | namespace dec { |
15 | | |
16 | 20.4k | State::State() : internal(new InternalState()) {} |
17 | | |
18 | 0 | State::State(State&&) = default; |
19 | | |
20 | 20.4k | State::~State() {} |
21 | | |
22 | 20.4k | MetadataState::~MetadataState() { |
23 | 20.4k | if (brotli != nullptr) { |
24 | 2.38k | BrotliDecoderDestroyInstance(brotli); |
25 | 2.38k | brotli = nullptr; |
26 | 2.38k | } |
27 | 20.4k | } |
28 | | |
29 | 477k | bool HasSection(const State* state, uint32_t tag) { |
30 | 477k | return state->internal->section.tags_met & (1u << tag); |
31 | 477k | } |
32 | | |
33 | | } // namespace dec |
34 | | } // namespace internal |
35 | | } // namespace brunsli |