/proc/self/cwd/parser/source_factory.h
Line | Count | Source |
1 | | // Copyright 2021 Google LLC |
2 | | // |
3 | | // Licensed under the Apache License, Version 2.0 (the "License"); |
4 | | // you may not use this file except in compliance with the License. |
5 | | // You may obtain a copy of the License at |
6 | | // |
7 | | // https://www.apache.org/licenses/LICENSE-2.0 |
8 | | // |
9 | | // Unless required by applicable law or agreed to in writing, software |
10 | | // distributed under the License is distributed on an "AS IS" BASIS, |
11 | | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | | // See the License for the specific language governing permissions and |
13 | | // limitations under the License. |
14 | | |
15 | | #ifndef THIRD_PARTY_CEL_CPP_PARSER_SOURCE_FACTORY_H_ |
16 | | #define THIRD_PARTY_CEL_CPP_PARSER_SOURCE_FACTORY_H_ |
17 | | |
18 | | #include <cstdint> |
19 | | #include <map> |
20 | | #include <utility> |
21 | | |
22 | | namespace google::api::expr::parser { |
23 | | |
24 | | class EnrichedSourceInfo { |
25 | | public: |
26 | | explicit EnrichedSourceInfo( |
27 | | std::map<int64_t, std::pair<int32_t, int32_t>> offsets) |
28 | 1.32k | : offsets_(std::move(offsets)) {} |
29 | | |
30 | | EnrichedSourceInfo() = default; |
31 | | EnrichedSourceInfo(const EnrichedSourceInfo& other) = default; |
32 | | EnrichedSourceInfo& operator=(const EnrichedSourceInfo& other) = default; |
33 | 7.94k | EnrichedSourceInfo(EnrichedSourceInfo&& other) = default; |
34 | | EnrichedSourceInfo& operator=(EnrichedSourceInfo&& other) = default; |
35 | | |
36 | 0 | const std::map<int64_t, std::pair<int32_t, int32_t>>& offsets() const { |
37 | 0 | return offsets_; |
38 | 0 | } |
39 | | |
40 | | private: |
41 | | // A map between node_id and pair of start position and end position |
42 | | std::map<int64_t, std::pair<int32_t, int32_t>> offsets_; |
43 | | }; |
44 | | |
45 | | } // namespace google::api::expr::parser |
46 | | |
47 | | #endif // THIRD_PARTY_CEL_CPP_PARSER_SOURCE_FACTORY_H_ |